我使用一个自定义函数从
here复位标签号和视口号(见Tonymec的评论).您可以使用它来更改显示选项卡的方式.
这是我的.vimrc中的.这只是一个稍微修改的版本,它改变了选项卡#和视口#的显示方式.
"Rename tabs to show tab# and # of viewports
if exists("+showtabline")
function! MyTabLine()
let s = ''
let wn = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' '
let wn = tabpagewinnr(i,'$')
let s .= (i== t ? '%#TabNumSel#' : '%#TabNum#')
let s .= i
if tabpagewinnr(i,'$') > 1
let s .= '.'
let s .= (i== t ? '%#TabWinNumSel#' : '%#TabWinNum#')
let s .= (tabpagewinnr(i,'$') > 1 ? wn : '')
end
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let bufnr = buflist[winnr - 1]
let file = bufname(bufnr)
let buftype = getbufvar(bufnr,'buftype')
if buftype == 'nofile'
if file =~ '\/.'
let file = substitute(file,'.*\/\ze.','','')
endif
else
let file = fnamemodify(file,':p:t')
endif
if file == ''
let file = '[No Name]'
endif
let s .= file
let s .= (i == t ? '%m' : '')
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
endif
这里是我的功能中定义的颜色
set tabpagemax=15
hi TabLineSel term=bold cterm=bold ctermfg=16 ctermbg=229
hi TabWinNumSel term=bold cterm=bold ctermfg=90 ctermbg=229
hi TabNumSel term=bold cterm=bold ctermfg=16 ctermbg=229
hi TabLine term=underline ctermfg=16 ctermbg=145
hi TabWinNum term=bold cterm=bold ctermfg=90 ctermbg=145
hi TabNum term=bold cterm=bold ctermfg=16 ctermbg=145