如果要 hack git 的東西還可以整合 git 的東西:
if winwidth(0) >= 120
set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?
&fenc:&enc).':'.&ff.']'}%y\ %(%{GitBranch()}\ %)\ %F%=[%{GetB()}]\ %l,
%c%V%8P
else
set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?
&fenc:&enc).':'.&ff.']'}%y\ %(%{GitBranch()}\ %)\ %F%=[%{GetB()}]\ %l,
%c%V%8P
endif
當然要寫一下 GetBranch function 跟 GetB function.
:p