Created
December 22, 2012 00:03
-
-
Save cwmaguire/4356675 to your computer and use it in GitHub Desktop.
vimrc statusline jiggery pokery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Status Line Jiggery Pokery | |
" Use term=bold in teh user highlights for bold | |
hi User1 ctermbg=darkgrey ctermfg=blue guibg=darkgrey guifg=blue | |
hi User2 ctermbg=darkgrey ctermfg=black guibg=darkgrey guifg=black | |
hi User3 ctermbg=blue ctermfg=white guibg=blue guifg=white | |
hi User4 ctermbg=black ctermfg=yellow guibg=black guifg=orange | |
hi User5 ctermbg=black ctermfg=red guibg=black guifg=red gui=bold | |
set statusline= | |
set statusline+=%1* "switch to User1 highlight | |
set statusline+=\ \ \ "spacing | |
set statusline+=%t "full filename | |
set statusline+=\ \ \ "spacing | |
set statusline+=%* "switch back to statusline highlight | |
set statusline+=\ \ \ "spacing | |
set statusline+=%2* "switch to User2 highlight | |
set statusline+=%y "filetype | |
set statusline+=%* "switch back to statusline highlight | |
set statusline+=\ \ \ "spacing | |
set statusline+=%l "line number | |
set statusline+=/ | |
set statusline+=%L "percentage thru file | |
set statusline+=\ \ \ "space | |
set statusline+=Buffer\ \# | |
set statusline+=%-3.b "buffer number | |
set statusline+=\ \ \ "spacing | |
set statusline+=Col\ | |
set statusline+=%3* "switch to User2 highlight | |
set statusline+=\ "spacing | |
set statusline+=%-.c "column number | |
set statusline+=\ "spacing | |
set statusline+=%* "switch to User3 highlight | |
set statusline+=\ \ \ "spacing | |
set statusline+=Byte\ | |
set statusline+=%4* "switch to User2 highlight | |
set statusline+=\ "spacing | |
set statusline+=%-b "column number | |
set statusline+=\ "spacing | |
set statusline+=%* "switch back to satusline highlight | |
set statusline+=\ \ \ "spacing | |
set statusline+=%5* "switch to User2 highlight | |
set statusline+=%8m "modified flag, right-align | |
set statusline+=%-8m "modified flag, left-align | |
set statusline+=%* "switch to User3 highlight | |
" THIS IS FOR DYNAMICALLY CHANGING THE STATUS LINE WHEN IN DIFFERENT | |
" MODES | |
" first, enable status line always | |
" This is key to make the colours show up; not sure why | |
set laststatus=2 | |
function! InsertStatuslineColor(mode) | |
if a:mode == 'i' | |
hi User1 guibg=yellow | |
elseif a:mode == 'r' | |
hi User1 guibg=yellow | |
else | |
hi User1 guibg=red | |
endif | |
endfunction | |
au InsertEnter * call InsertStatuslineColor(v:insertmode) | |
au InsertLeave * hi User1 guibg=darkgrey | |
" default the statusline to green when entering Vim | |
hi User1 guibg=darkgrey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment