Added the git branch in the statusline
This commit is contained in:
parent
0ec5de785c
commit
0338073f9d
@ -162,6 +162,15 @@ highlight ColorColumn ctermbg=236
|
||||
""""""""""""""""""""""""""""""""
|
||||
" Status Line
|
||||
""""""""""""""""""""""""""""""""
|
||||
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+=%#IncSearch#
|
||||
set statusline+=\ %y
|
||||
@ -170,6 +179,7 @@ set statusline+=\ %r
|
||||
set statusline+=%#CursorLineNr#
|
||||
set statusline+=\ %F
|
||||
set statusline+=%= "Right side settings
|
||||
set statusline+=%{StatuslineGit()}
|
||||
set statusline+=%#Search#
|
||||
set statusline+=\ %l/%L
|
||||
set statusline+=\ [%c]
|
||||
|
Loading…
Reference in New Issue
Block a user