aboutsummaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-04-19 05:27:24 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-04-19 05:27:24 +0200
commitd582cb408f0479b5124647d5293b079f29cca8d3 (patch)
tree705c64385026ca292b2aa4f0cc715ac0a5e0bc38 /vim
parent595af069ac493e2d132c617afe32353bdd016afa (diff)
downloaddotfiles-d582cb408f0479b5124647d5293b079f29cca8d3.tar.xz
vim: Add custom statusline
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc33
1 files changed, 33 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 8e4aa8e..23e562e 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -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