summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2014-12-18 15:45:19 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2014-12-18 15:45:19 +0100
commit2731ba35b11c2908ed9ffa968af456447dcfba38 (patch)
tree2754609460f3b37a13a74cbfd2f62108f4ee1296
parent3b2d0f240f8ac4013f5d403fefba30a4abb0b4d4 (diff)
[tab] TabLine
-rw-r--r--vimrc31
1 files changed, 31 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index b2c7393..ed9a854 100644
--- a/vimrc
+++ b/vimrc
@@ -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