summaryrefslogtreecommitdiff
authorDiego Ongaro <ongardie@gmail.com>2009-05-29 04:48:16 (GMT)
committer Diego Ongaro <ongardie@gmail.com>2009-05-29 04:48:16 (GMT)
commitae39cc8678860376a07cd3e797f78135cb134fa3 (patch)
treeb73f46255378637b5e5610b67b3d0f7ed253676b
parent8db9bc296aa6d8158c8bc54a99287c161ac85fc0 (diff)
downloadvim-ae39cc8678860376a07cd3e797f78135cb134fa3.zip
vim-ae39cc8678860376a07cd3e797f78135cb134fa3.tar.gz
vim-ae39cc8678860376a07cd3e797f78135cb134fa3.tar.bz2
Adds tab options
Diffstat
-rw-r--r--vimrc30
1 files changed, 30 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 11398c9..c986713 100644
--- a/vimrc
+++ b/vimrc
@@ -61,4 +61,34 @@ endif
let g:openssl_backup = 1
+function! GuiTabLabel()
+ " buffer_number[+] buffer_name [(number_windows)]
+
+ " Add buffer number
+ let label = v:lnum
+
+ " Add '+' if one of the buffers in the tab page is modified
+ let bufnrlist = tabpagebuflist(v:lnum)
+ for bufnr in bufnrlist
+ if getbufvar(bufnr, "&modified")
+ let label .= '+'
+ break
+ endif
+ endfor
+
+ " Append the buffer name
+ let label .= ' ' . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
+
+ " Append the number of windows in the tab page if more than one
+ let wincount = tabpagewinnr(v:lnum, '$')
+ if wincount > 1
+ let label .= ' (' . wincount . ')'
+ endif
+
+ return label
+endfunction
+
+set guitablabel=%{GuiTabLabel()}
+set tabpagemax=1000
+
" vim: set ts=2 sw=2 ai si et :