You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
620 B
VimL
24 lines
620 B
VimL
7 years ago
|
function! GitBranch()
|
||
|
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
||
|
endfunction
|
||
|
|
||
|
function! StatuslineGit()
|
||
|
let l:branchname = GitBranch()
|
||
|
return strlen(l:branchname) > 0?' '.l:branchname.' ':''
|
||
|
endfunction
|
||
|
|
||
|
set statusline=
|
||
|
set statusline+=%#PmenuSel#
|
||
|
set statusline+=%{StatuslineGit()}
|
||
|
set statusline+=%#LineNr#
|
||
|
set statusline+=\ %f
|
||
|
set statusline+=%m\
|
||
|
set statusline+=%=
|
||
|
set statusline+=%#CursorColumn#
|
||
|
set statusline+=\ %y
|
||
|
set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
|
||
|
set statusline+=\[%{&fileformat}\]
|
||
|
set statusline+=\ %p%%
|
||
|
set statusline+=\ %l:%c
|
||
|
set statusline+=\
|