mirror of
https://github.com/amix/vimrc
synced 2024-12-13 05:32:34 +00:00
3c8e295105
Switched away from using gui tabs and made some changes to the default text tab via set_tabline.vim plugin. Added a new mapping <leader>t<leader> that can open a specific tab number.
30 lines
814 B
VimL
30 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()
|