~gpanders/dotfiles

ref: 8bbb6b42ada8c7e573ffba9c35b376dd6bec1d15 dotfiles/vim/.vim/plugin/tabline.vim -rw-r--r-- 599 bytes
8bbb6b42Greg Anders Move weechat config directory to .config/weechat 2 years ago
                                                                                
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
" Set the tabline
" Author: Greg Anders <greg@gpanders.com>
" Date: 2019-07-10

function! TabLine()
  let s = ''
  for i in range(tabpagenr('$'))
    " Set the highlighting
    if i +1 == tabpagenr()
      let s .= '%#TabLineSel#'
    else
      let s .= '%#TabLine#'
    endif

    " Set the tab page number
    let s .= '%' . (i + 1) . 'T'

    " Set the tab label
    let s .= ' ' . pathshorten(fnamemodify(getcwd(1, i + 1), ':~:.')) . ' '
  endfor

  " After the last tab fill with TabLineFill and reset tab page nr
  let s .= '%#TabLineFill#%T'

  return s
endfunction

set tabline=%!TabLine()