From dec61653987f584822f87515281e9f82aaac972f Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 3 May 2025 14:25:55 -0700 Subject: old neovim config --- config/nvim-archive/plugin/Tabline.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 config/nvim-archive/plugin/Tabline.vim (limited to 'config/nvim-archive/plugin') diff --git a/config/nvim-archive/plugin/Tabline.vim b/config/nvim-archive/plugin/Tabline.vim new file mode 100644 index 0000000..8f91b72 --- /dev/null +++ b/config/nvim-archive/plugin/Tabline.vim @@ -0,0 +1,32 @@ +fu! MyTabLabel(n) +let buflist = tabpagebuflist(a:n) +let winnr = tabpagewinnr(a:n) +let string = fnamemodify(bufname(buflist[winnr - 1]), ':t') +return empty(string) ? '[unnamed]' : string +endfu + +fu! 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' + " display tabnumber (for use with gt, etc) + let s .= ' '. (i+1) . ' ' + + " the label is made by MyTabLabel() + let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' + + if i+1 < tabpagenr('$') + let s .= ' |' + endif +endfor +return s +endfu +set tabline=%!MyTabLine() -- cgit v1.2.3