git branch in status line once again

This commit is contained in:
gurkenhabicht 2023-07-19 00:30:51 +02:00
parent beca3fccfb
commit 15b59069e8
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ set hlsearch
syntax on
filetype plugin on
set tabstop=4 shiftwidth=4 autoindent smartindent expandtab
set mouse=a
set mouse=v
"set noswapfile
" Numbering of lines
@ -72,7 +72,7 @@ hi CursorLine cterm=NONE ctermbg=darkgrey ctermfg=white
" return strlen(l:branchname) > 0?' '.l:branchname.' ':''
" endfunction
function! UpdateGitBranch()
let l:branchname = system("git rev-parse --abbrev-ref head 2>/dev/null | tr -d '\n'")
let l:branchname = system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
let b:branchstatus = strlen(l:branchname) > 0? ' '.l:branchname.' ':''
endfunction
@ -89,7 +89,7 @@ set laststatus=2
set statusline=
set statusline+=%#PmenuSel#
" set statusline+=%{StatuslineGit()}
" set statusline+=%{b:branchstatus}
set statusline+=%{b:branchstatus}
set statusline+=%#BufTabLineCurrent#
set statusline+=\ %M
set statusline+=\ %r