From 2731ba35b11c2908ed9ffa968af456447dcfba38 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 18 Dec 2014 15:45:19 +0100 Subject: [tab] TabLine --- vimrc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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 -- cgit v1.2.3