diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-04-19 05:27:24 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-04-19 05:27:24 +0200 |
commit | d582cb408f0479b5124647d5293b079f29cca8d3 (patch) | |
tree | 705c64385026ca292b2aa4f0cc715ac0a5e0bc38 /vim | |
parent | 595af069ac493e2d132c617afe32353bdd016afa (diff) | |
download | dotfiles-d582cb408f0479b5124647d5293b079f29cca8d3.tar.xz |
vim: Add custom statusline
Diffstat (limited to 'vim')
-rw-r--r-- | vim/vimrc | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -90,3 +90,36 @@ autocmd InsertLeave * match ExtraWhitespace /\s\+$/ autocmd BufWinLeave * call clearmatches() highlight Comment cterm=italic + + +"" Statusline + +set statusline= +set statusline+=[%n] " Buffer number +set statusline+=%<\ " Where to truncate +set statusline+=%.99f " Relative path to file +set statusline+=\ %y " Filetype flag, [c]; [help] +set statusline+=%w " Preview window flag, [Preview] +set statusline+=%m " Modified flag, [+]; [-] + +" Show a warning if file is read only, [RO] +set statusline+=%#identifier# +set statusline+=%r +set statusline+=%* + +" Show a warning if file format isn’t unix +set statusline+=%#warningmsg# +set statusline+=%{&ff!='unix'?'['.&ff.']':''} +set statusline+=%* + +" Show a warning if file encoding isn’t utf-8 +set statusline+=%#warningmsg# +set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''} +set statusline+=%* + +"" Right side of statusline +set statusline+=%= " Left/right separation point +set statusline+=%-15.((%l,%c-%v)\ %) " Line, column, percentage. (20,0) +set statusline+=%P " Percentage visible + +set laststatus=2 " Always show statusline |