Added the git branch in the statusline
This commit is contained in:
		@@ -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]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user