titlestring

This commit is contained in:
ManjaroOne666 2018-09-02 16:11:29 +01:00
commit ebb0b7b33b

View file

@ -48,6 +48,21 @@ set spelllang=en_gb
set dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
set thesaurus+=/usr/share/dict/mthesaur.txt
function! GetGitRoot() abort
let gitroot=system("git rev-parse --show-toplevel")
if gitroot=~?"^fatal"
let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
let gitstring .= expand("%t")
else
let gitstring = system("echo ${PWD/#$HOME/'~'}") . "/"
let gitstring .= expand("%t")
let gitstring .= " [ " . system("git branch | grep '*' | cut -d ' ' -f2")
let gitstring .= " ] ( " . system('basename "' . gitroot . '"') . " )"
endif
return gitstring
endfunction
let &titlestring="%{GetGitRoot()}"
set title
set tabstop=8
set softtabstop=2