Skip to content

Instantly share code, notes, and snippets.

@glucero
Created July 15, 2013 18:55
Show Gist options
  • Select an option

  • Save glucero/6002423 to your computer and use it in GitHub Desktop.

Select an option

Save glucero/6002423 to your computer and use it in GitHub Desktop.
my tab line
function TabLine()
let s = ''
let t = tabpagenr()
let i = 1
while l:i <= tabpagenr('$')
let buflist = tabpagebuflist(l:i)
let winnr = tabpagewinnr(l:i)
let s .= '%' . l:i . 'T'
let s .= (l:i == l:t) ? '%1*' : '%2*'
let s .= '%*'
let s .= (l:i == l:t) ? '%#TabLineSel#' : '%#TabLine#'
let s .= ' ' . l:i . ' '
let file = bufname(buflist[l:winnr - 1])
let file = fnamemodify(l:file, ':p:t')
if l:file == ''
let file = '[No Name]'
endif
let s .= l:file . ' '
let i = l:i + 1
endwhile
let s .= '%T%#TabLineFill#%='
return l:s
endfunction
set showtabline=1
set tabline=%!TabLine()
@glucero
Copy link
Copy Markdown
Author

glucero commented Jul 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment