Skip to content

Commit c759f61

Browse files
committed
Change colortheme and statusline look
1 parent 214f981 commit c759f61

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

funcs.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,16 @@ function! g:List_toggle()
4646
echo (&list ? l:list_feat : l:nolist_feat)."! (but not ".
4747
\ (&list ? l:nolist_feat : l:list_feat).")"
4848
endfunction
49+
50+
function! g:SetSTLColors()
51+
" This function set user highlight groups to appropriate guifg color of
52+
" themes StatusLine highlight group.
53+
redir => stl_hl_group
54+
silent hi! StatusLine
55+
redir END
56+
let fgcolor = matchstr(stl_hl_group,'\vguifg\=\#\zs.{6}\ze')
57+
exec 'silent hi! User1 guifg=#'.fgcolor.' guibg=#1d1f21'.' gui=NONE,reverse term=NONE,reverse'
58+
exec 'silent hi! User2 guifg=#'.fgcolor.' guibg=#dd3333'.' gui=NONE,reverse term=NONE,reverse'
59+
exec 'silent hi! User3 guifg=#'.fgcolor.' guibg=#eea040'.' gui=NONE,reverse term=NONE,reverse'
60+
exec 'silent hi! User4 guifg=#'.fgcolor.' guibg=#a0ee40'.' gui=NONE,reverse term=NONE,reverse'
61+
endfunction

vimrc

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ source ~/.vim/funcs.vim
1313
Bundle 'JazzCore/vundle'
1414
Bundle 'JazzCore/ctrlp-cmatcher'
1515
Bundle 'JazzCore/ultisnips-snippets'
16+
Bundle 'JazzCore/mustang-vim'
17+
Bundle 'JazzCore/vim-hybrid'
1618
Bundle 'tpope/vim-fugitive'
1719
Bundle 'tpope/vim-surround'
1820
Bundle 'tpope/vim-endwise'
@@ -32,7 +34,6 @@ Bundle 'kien/ctrlp.vim'
3234
Bundle 'tacahiroy/ctrlp-funky'
3335
Bundle 'mileszs/ack.vim'
3436
Bundle 'Raimondi/delimitMate'
35-
Bundle 'croaker/mustang-vim'
3637
Bundle 'telamon/vim-color-github'
3738
Bundle 'alfredodeza/pytest.vim'
3839
Bundle 'mbbill/undotree'
@@ -41,7 +42,7 @@ Bundle 'Spaceghost/vim-matchit'
4142
Bundle 'gregsexton/gitv'
4243
Bundle 'xolox/vim-session'
4344
Bundle "myusuf3/numbers.vim"
44-
Bundle "klen/python-mode"
45+
"Bundle "klen/python-mode"
4546
Bundle 'Decho'
4647
Bundle 'bufexplorer.zip'
4748
" Check it
@@ -132,7 +133,8 @@ set foldopen=block,hor,mark,percent,quickfix,tag " what movements open folds
132133

133134
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
134135

135-
colorscheme mustang
136+
"colorscheme mustang
137+
colorscheme hybrid
136138
set background=dark " Assume a dark background
137139

138140
highlight clear SignColumn " SignColumn should match background for things like vim-gitgutter
@@ -194,10 +196,23 @@ endif
194196
set tags=./tags;/
195197

196198
" Set the status line
197-
set stl=%f\ %m\ %r%{fugitive#statusline()}\ Line:%l/%L[%p%%]\ Col:%v\ Buf:#%n\ [%b][0x%B]
199+
set statusline=%<%F " File path
200+
set statusline+=\ %2*%{&ro?'RO':''}%*%4*%{&mod?'+':''}%<%* " RO and modification flags. %2 - red, %4 - green
201+
set statusline+=%3*\ %{matchstr(fugitive#statusline(),'(\\zs.*\\ze)')}%* " Fugitive flag. %3 - orange
202+
set statusline+=%=\ %{&fileformat}\ \| " Remaining items are right-aligned. File format
203+
set statusline+=%{&fileencoding}\ \| " Encoding
204+
set statusline+=%{&filetype}\ \| " filetype
205+
set statusline+=%p%%\ \| " % of document
206+
set statusline+=%l:%c\ " Line num and col
207+
198208
" tell VIM to always put a status line in, even if there is only one window
199209
set laststatus=2
200210

211+
" We need to update this colors to match stl background color of the new theme
212+
autocmd ColorScheme * silent! call g:SetSTLColors()
213+
214+
call g:SetSTLColors()
215+
201216
" Highlight trailing whitespace (but not in insert mode)
202217
highlight ExtraWhitespace ctermbg=red guibg=red
203218
match ExtraWhitespace /\s\+$/
@@ -378,3 +393,5 @@ let g:jedi#auto_initialization = 1
378393
let g:jedi#goto_command = "<leader>g"
379394
let g:jedi#get_definition_command = "<leader>d"
380395
let g:jedi#use_tabs_not_buffers = 0
396+
397+
let python_highlight_all=1

0 commit comments

Comments
 (0)