mirror of
https://github.com/amix/vimrc
synced 2024-12-12 05:02:30 +00:00
31 lines
814 B
VimL
31 lines
814 B
VimL
|
function! CustomizedTabLine()
|
||
|
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 .= '%*'
|
||
|
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 s .= ' '
|
||
|
let i = i + 1
|
||
|
endwhile
|
||
|
let s .= '%T%#TabLineFill#%='
|
||
|
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
|
||
|
return s
|
||
|
endfunction
|
||
|
|
||
|
" Always show the tablilne
|
||
|
set stal=2
|
||
|
set tabline=%!CustomizedTabLine()
|