-
-
Save grangerp/6a6c401f9ea8a7dd6745c9fa133c7a01 to your computer and use it in GitHub Desktop.
Vim Powerline-like status line without the need of any plugin
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
" Statusline (requires Powerline font) | |
set statusline= | |
set statusline+=%(%{'help'!=&filetype?bufnr('%'):''}\ \ %) | |
set statusline+=%< " Where to truncate line | |
set statusline+=%f " Path to the file in the buffer, as typed or relative to current directory | |
set statusline+=%{&modified?'\ +':''} | |
set statusline+=%{&readonly?'\ ':''} | |
set statusline+=%= " Separation point between left and right aligned items | |
set statusline+=\ %{''!=#&filetype?&filetype:'none'} | |
set statusline+=%(\ %{(&bomb\|\|'^$\|utf-8'!~#&fileencoding?'\ '.&fileencoding.(&bomb?'-bom':''):'') | |
\.('unix'!=#&fileformat?'\ '.&fileformat:'')}%) | |
set statusline+=%(\ \ %{&modifiable?(&expandtab?'et\ ':'noet\ ').&shiftwidth:''}%) | |
set statusline+=\ | |
set statusline+=\ %2v " Virtual column number | |
set statusline+=\ %3p%% " Percentage through file in lines as in |CTRL-G| | |
" ------------------------ 8< ------------------------ | |
" Statusline (requires Powerline font, with highlight groups using Solarized theme) | |
set statusline= | |
set statusline+=%(%{'help'!=&filetype?bufnr('%'):''}\ \ %) | |
set statusline+=%< " Where to truncate line | |
set statusline+=%f " Path to the file in the buffer, as typed or relative to current directory | |
set statusline+=%{&modified?'\ +':''} | |
set statusline+=%{&readonly?'\ ':''} | |
set statusline+=\ %1* | |
set statusline+=%= " Separation point between left and right aligned items. | |
set statusline+=\ %{''!=#&filetype?&filetype:'none'} | |
set statusline+=%(\ %{(&bomb\|\|'^$\|utf-8'!~#&fileencoding?'\ '.&fileencoding.(&bomb?'-bom':''):'') | |
\.('unix'!=#&fileformat?'\ '.&fileformat:'')}%) | |
set statusline+=%(\ \ %{&modifiable?(&expandtab?'et\ ':'noet\ ').&shiftwidth:''}%) | |
set statusline+=\ %* | |
set statusline+=\ %2v " Virtual column number. | |
set statusline+=\ %3p%% " Percentage through file in lines as in |CTRL-G| | |
" Logic for customizing the User1 highlight group is the following | |
" - fg = StatusLine fg (if StatusLine colors are reverse) | |
" - bg = StatusLineNC bg (if StatusLineNC colors are reverse) | |
hi StatusLine term=reverse cterm=reverse gui=reverse ctermfg=14 ctermbg=8 guifg=#93a1a1 guibg=#002b36 | |
hi StatusLineNC term=reverse cterm=reverse gui=reverse ctermfg=11 ctermbg=0 guifg=#657b83 guibg=#073642 | |
hi User1 ctermfg=14 ctermbg=0 guifg=#93a1a1 guibg=#073642 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment