Add GuiTabLabel
This commit is contained in:
parent
46e2cbec8b
commit
330f6e54fc
1 changed files with 28 additions and 0 deletions
28
.vimrc
28
.vimrc
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue