X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Fbuftabline.vim;h=4e48497bed24e1b63643f3c63f56335c40124b71;hb=7289e4fac33ed44da82ddb8f6ed1932f67e05189;hp=30a0c3c416c05aa68d0308be711a0791825ea8b7;hpb=6c6fe3e2e925f1413464b5051680df5b3e4ec53a;p=dotfiles.git diff --git a/vim/.vim/plugin/buftabline.vim b/vim/.vim/plugin/buftabline.vim index 30a0c3c..4e48497 100644 --- a/vim/.vim/plugin/buftabline.vim +++ b/vim/.vim/plugin/buftabline.vim @@ -3,18 +3,20 @@ function! BufTabline() silent buffers redir END let bufs = [] - for buf in split(bufsRaw, "\n") + for buf in split(bufsRaw, "\n")[:16] let buf = substitute(buf, "\"", "", "g") let ents = [] for ent in split(buf, " ") if len(ent) == 0 | continue | endif let ents = add(ents, substitute(ent, "%", "%%", "g")) endfor - let ents = ents[:-3] + let linenum = ents[-1] + let ents = ents[:-3] " strip message with line number if len(ents) == 4 | let ents = [ents[0], ents[1] . ents[2], ents[3]] | endif if len(ents) == 3 | let ents = [ents[0] . ":" . ents[1], ents[2]] | endif let ents[0] = "%#TabLine#" . ents[0] . "%*" - if len(ents[1]) > 20 | let ents[1] = "<" . ents[1][-19:] | endif + if len(ents[1]) > 20 | let ents[1] = "<" . ents[1][-(20-1):] | endif + let ents[1] = ents[1] . ":" . linenum if match(ents[0], "%%") == -1 let ents[1] = "%#TabLine#:" . ents[1] . "%*" else @@ -22,7 +24,7 @@ function! BufTabline() endif let bufs = add(bufs, join(ents[:1], "")) endfor - return join(bufs, "%#Comment#|%*") + return join(bufs, " ") endfunction set showtabline=2