Hi guys,

VIM allows has an option ‘tabline’ that one can use to configure how the tab line would look like. Back when I used to use gvim, I could very easily manipulate how the text on the tab looked like by setting the ‘guitablabel’ setting, however ‘tabline’ is not all that easy to configure.

Here is what I use now :

function! MyTabLine() let s = '' for i in range(tabpagenr('$')) let tabnr = i + 1 " range() starts at 0 let winnr = tabpagewinnr(tabnr) let buflist = tabpagebuflist(tabnr) let bufnr = buflist[winnr - 1] let bufname = fnamemodify(bufname(bufnr), ':t') let s .= '%' . tabnr . 'T' let s .= (tabnr == tabpagenr() ? '%#TabLineSel#' : '%#TabLine#') let s .= ' ' . tabnr let n = tabpagewinnr(tabnr,'$') if n > 1 | let s .= ':' . n | endif let s .= empty(bufname) ? ' [No Name] ' : ' ' . bufname . ' ' let bufmodified = getbufvar(bufnr, "&mod") if bufmodified | let s .= '+ ' | endif endfor let s .= '%#TabLineFill#' return s endfunction set tabline=%!MyTabLine() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 function ! MyTabLine ( ) let s = '' for i in range ( tabpagenr ( '$' ) ) let tabnr = i + 1 " range() starts at 0 let winnr = tabpagewinnr ( tabnr ) let buflist = tabpagebuflist ( tabnr ) let bufnr = buflist [ winnr - 1 ] let bufname = fnamemodify ( bufname ( bufnr ) , ':t' ) let s . = '%' . tabnr . 'T' let s . = ( tabnr == tabpagenr ( ) ? '%#TabLineSel#' : '%#TabLine#' ) let s . = ' ' . tabnr let n = tabpagewinnr ( tabnr , '$' ) if n > 1 | let s . = ':' . n | endif let s . = empty ( bufname ) ? ' [No Name] ' : ' ' . bufname . ' ' let bufmodified = getbufvar ( bufnr , "&mod" ) if bufmodified | let s . = '+ ' | endif endfor let s . = '%#TabLineFill#' return s endfunction set tabline = % ! MyTabLine ( )

This is what it looks like :