Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hanzhixing/.vim
base: c0aa679782
...
head fork: hanzhixing/.vim
compare: 7d597699ce
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 70 additions and 0 deletions.
  1. +35 −0 vimrc.with_plugins
  2. +35 −0 vimrc.without_plugins
View
35 vimrc.with_plugins
@@ -62,6 +62,41 @@ set statusline=%F%m%r%h%w%y
\(exists(\"+bomb\")\ &&\ &bomb)?\",BOM\":\"\").\"]\"}
\\ [%{&ff}]\ [%l,%v(%p%%)]\ [LEN=%L]\ [\\%03.3b,\0x%04.4B]
+" Set tabline
+set showtabline=2 " always show tabs in gvim, but not vim
+" set up tab labels with tab number, buffer name, number of windows
+function! GuiTabLabel()
+ let label = ''
+ let bufnrlist = tabpagebuflist(v:lnum)
+ " Add '+' if one of the buffers in the tab page is modified
+ for bufnr in bufnrlist
+ if getbufvar(bufnr, "&modified")
+ let label = '+'
+ break
+ endif
+ endfor
+ " Append the tab number
+ let label .= v:lnum.': '
+ " Append the buffer name
+ let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
+ if name == ''
+ " give a name to no-name documents
+ if &buftype=='quickfix'
+ let name = '[Quickfix List]'
+ else
+ let name = '[No Name]'
+ endif
+ else
+ " get only the file name
+ let name = fnamemodify(name,":t")
+ endif
+ let label .= name
+ " Append the number of windows in the tab page
+ let wincount = tabpagewinnr(v:lnum, '$')
+ return label . ' [' . wincount . ']'
+endfunction
+set guitablabel=%{GuiTabLabel()}
+
" Enable syntax highlight.
syntax on
View
35 vimrc.without_plugins
@@ -56,6 +56,41 @@ set statusline=%F%m%r%h%w%y
\(exists(\"+bomb\")\ &&\ &bomb)?\",BOM\":\"\").\"]\"}
\\ [%{&ff}]\ [%l,%v(%p%%)]\ [LEN=%L]\ [\\%03.3b,\0x%04.4B]
+" Set tabline
+set showtabline=2 " always show tabs in gvim, but not vim
+" set up tab labels with tab number, buffer name, number of windows
+function! GuiTabLabel()
+ let label = ''
+ let bufnrlist = tabpagebuflist(v:lnum)
+ " Add '+' if one of the buffers in the tab page is modified
+ for bufnr in bufnrlist
+ if getbufvar(bufnr, "&modified")
+ let label = '+'
+ break
+ endif
+ endfor
+ " Append the tab number
+ let label .= v:lnum.': '
+ " Append the buffer name
+ let name = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
+ if name == ''
+ " give a name to no-name documents
+ if &buftype=='quickfix'
+ let name = '[Quickfix List]'
+ else
+ let name = '[No Name]'
+ endif
+ else
+ " get only the file name
+ let name = fnamemodify(name,":t")
+ endif
+ let label .= name
+ " Append the number of windows in the tab page
+ let wincount = tabpagewinnr(v:lnum, '$')
+ return label . ' [' . wincount . ']'
+endfunction
+set guitablabel=%{GuiTabLabel()}
+
" Enable syntax highlight.
syntax on

No commit comments for this range

Something went wrong with that request. Please try again.