Add GuiTabLabel

This commit is contained in:
Hunter Haugen 2013-03-22 10:44:05 -07:00
parent 46e2cbec8b
commit 330f6e54fc

28
.vimrc
View file

@ -1162,6 +1162,34 @@ let g:ctrlp_working_path_mode = 1
let g:ctrlp_switch_buffer = 1 let g:ctrlp_switch_buffer = 1
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'
" GuiTabLabel
function GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
" Append the number of windows in the tab page if more than one
let wincount = tabpagewinnr(v:lnum, '$')
if wincount > 1
let label .= wincount
endif
if label != ''
let label .= ' '
endif
" Append the buffer name
return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
endfunction
set guitablabel=%{GuiTabLabel()}
" }}}1 " }}}1
if v:version >= 703 if v:version >= 703