2
目前運行:定製標籤提示,顯示緩衝區列表
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 1 2012 18:08:47)
MacOS X (unix) version
Included patches: 1-646
Compiled by Bjorn Winckler <[email protected]>
我在.gvimrc裏下面的代碼應該顯示所有緩衝區作爲工具提示的列表。但是,它只顯示在當前選項卡(分割窗口)中明顯打開的緩衝區列表。 :buffers
命令正確列出所有緩衝區。
我誤解了這段代碼的意思(我是Vim腳本的新手;這段代碼是從開源配置中借用的)?
"show tooltips on tabs
set guitabtooltip=%{GuiTabToolTip()}
" set up tab tooltips with every buffer name
function! GuiTabToolTip()
let tip = ''
let bufnrlist = tabpagebuflist(v:lnum)
for bufnr in bufnrlist
" separate buffer entries
if tip!=''
let tip .= ' | '
endif
" Add name of buffer
let name=bufname(bufnr)
if name == ''
" give a name to no name documents
if getbufvar(bufnr,'&buftype')=='quickfix'
let name = '[Quickfix List]'
else
let name = '[No Name]'
endif
endif
let tip.=name
" add modified/modifiable flags
if getbufvar(bufnr, "&modified")
let tip .= ' [+]'
endif
if getbufvar(bufnr, "&modifiable")==0
let tip .= ' [-]'
endif
endfor
return tip
endfunction
謝謝;那完美的工作!我應該注意到這個問題。 – Chris