forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtabline.vim
More file actions
36 lines (31 loc) · 861 Bytes
/
tabline.vim
File metadata and controls
36 lines (31 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
" Tabline
" ===
function! Tabline()
" Active project name
let s:tabline =
\ '%#TabLineAlt# %{" " . badge#project()} %#TabLineAltShade#'
" Iterate through all tabs and collect labels
let l:current = tabpagenr()
for i in range(tabpagenr('$'))
let l:nr = i + 1
if l:nr == l:current
" Active tab
let s:tabline .=
\ '%#TabLineFill#%#TabLineSel# ' .
\ '%' . l:nr . 'T%{badge#filename(0, ' . l:nr . ', 1, 1)} ' .
\ '%#TabLineFill#'
else
" Normal tab
let s:tabline .=
\ '%#TabLine# '.
\ '%' . l:nr . 'T%{badge#filename(0, ' . l:nr . ', 1, 1)} ' .
\ ' '
endif
endfor
" Empty elastic space and session indicator
let s:tabline .=
\ '%#TabLineFill#%T%=%#TabLine#' .
\ '%{badge#session("' . fnamemodify(v:this_session, ':t:r') . ' ")}'
return s:tabline
endfunction
let &tabline='%!Tabline()'