Simon Jackson wrote:
how do you change the text in the file tabs up at the top?
The 'tabline' option is similar to 'statusline', but for the tabs line. Here's
what I use:
- in the vimrc:
if exists("+showtabline")
function MyTabLine()
let s = ''
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 s .= i . ':'
let s .= winnr . '/' . tabpagewinnr(i,'$')
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
map <F10> :tabnext<CR>
map! <F10> <C-O>:tabnext<CR>
map <S-F10> :tabprev<CR>
map! <S-F10> <C-O>:tabprev<CR>
endif
- in my "almost-default" colorscheme:
" define colors for the tab line:
" file name of unselected tab
hi TabLine gui=NONE guibg=#EEEEEE guifg=black
\ cterm=NONE,bold ctermbg=lightgrey ctermfg=white
" file name of selected tab (GUI default is bold black on white)
hi TabLineSel cterm=NONE,bold ctermbg=green ctermfg=white
" fillup and tab-delete "X" at right
hi TabLineFill gui=NONE,bold guibg=#CCCCCC guifg=#990000
\ cterm=NONE ctermbg=lightgrey ctermfg=red
" tab and file number 1:2/3 (meaning "tab 1: window 2 of 3) for selected tab
hi User1 gui=bold guibg=white guifg=magenta
\ ctermbg=green ctermfg=black
" tab and file number 1:2/3 for unselected tab
hi User2 guibg=#EEEEEE guifg=magenta
\ ctermbg=lightgrey ctermfg=black
Best regards,
Tony.
--
"Hey! Who took the cork off my lunch??!"
-- W. C. Fields