This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" returns a string <branch/XX> where XX corresponds to the git status | |
" (for example "<master/ M>") | |
function! CurrentGitStatus() | |
let gitoutput = systemlist('cd '.expand('%:p:h:S').' && git status --porcelain -b 2>/dev/null') | |
if len(gitoutput) > 0 | |
let b:gitstatus = strpart(get(gitoutput,0,''),3) .'/'. strpart(get(gitoutput,1,' '),1,2) | |
else | |
let b:gitstatus = '' | |
endif | |
endfunc |