Created
July 22, 2022 16:55
-
-
Save caesar0301/f510e0e1a21b93081ea06c9a223df05b to your computer and use it in GitHub Desktop.
This file contains 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! 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment