diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2014-12-18 15:45:19 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2014-12-18 15:45:19 +0100 |
commit | 2731ba35b11c2908ed9ffa968af456447dcfba38 (patch) | |
tree | 2754609460f3b37a13a74cbfd2f62108f4ee1296 | |
parent | 3b2d0f240f8ac4013f5d403fefba30a4abb0b4d4 (diff) |
[tab] TabLine
-rw-r--r-- | vimrc | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -15,6 +15,37 @@ set ruler set number set laststatus=2 +function! MyTabLine() + let s = '' + for i in range(tabpagenr('$')) + " select the highlighting + if i + 1 == tabpagenr() + let s .= '%#TabLineSel#' + else + let s .= '%#TabLine#' + endif + " set the tab page number (for mouse clicks) + let s .= '%' . (i + 1) . 'T' + " the label is made by MyTabLabel() + let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' + endfor + " after the last tab fill with TabLineFill and reset tab page nr + let s .= '%#TabLineFill#%T' + " right-align the label to close the current tab page + "if tabpagenr('$') > 1 + " let s .= '%=%#TabLine#%999Xclose' + "endif + return s +endfunction + +function! MyTabLabel(n) + let buflist = tabpagebuflist(a:n) + let winnr = tabpagewinnr(a:n) + return bufname(buflist[winnr - 1]) +endfunction + +set tabline=%!MyTabLine() + set wildmode=longest,list,full " Set Auto-indentation |