Created
July 15, 2013 18:55
-
-
Save glucero/6002423 to your computer and use it in GitHub Desktop.
my tab line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
Author
glucero
commented
Jul 15, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
