~gpanders/dotfiles

ref: 2da1dde5ea566f82ebe6532bc6d3b8670fd77ce8 dotfiles/vim/.vim/plugin/tabline.vim -rw-r--r-- 599 bytes
2da1dde5Greg Anders Note 'open' subcommand opens editor in NOTES_DIR when no argument given 1 year, 3 months 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()