titlestring

This commit is contained in:
ManjaroOne666 2018-09-02 16:11:29 +01:00
parent 39db6a06ea
commit ebb0b7b33b
1 changed files with 15 additions and 0 deletions

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 dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
set thesaurus+=/usr/share/dict/mthesaur.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 tabstop=8
set softtabstop=2 set softtabstop=2