Permalink
Browse files

update vimrc map and add gvimrc

  • Loading branch information...
1 parent 643df9b commit 5ce036f72acb92528fc55a2a4bfec4a4204a2720 @belltoy committed Dec 8, 2011
Showing with 90 additions and 3 deletions.
  1. +79 −0 vim/gvimrc
  2. +11 −3 vim/vimrc
View
@@ -0,0 +1,79 @@
+" -----------------------------------------------------------------------------
+" | VIM Settings |
+" | GUI stuff |
+" -----------------------------------------------------------------------------
+
+
+" OS Specific *****************************************************************
+if has("gui_macvim")
+
+" set fuoptions=maxvert,maxhorz " fullscreen options (MacVim only), resized window when changed to fullscreen
+ set guifont=DejaVu\ Sans\ YuanTi\ Mono\ 10
+ set guioptions-=T "去除工具栏
+ set stal=2 " turn on tabs by default
+
+elseif has("gui_gtk2")
+
+ set guifont=DejaVu\ Sans\ YuanTi\ Mono\ 10
+ set guioptions-=T "去除工具栏
+
+elseif has("x11")
+elseif has("gui_win32")
+end
+
+set guioptions=agie
+set nocul
+
+" General *********************************************************************
+set anti " Antialias font
+
+"set transparency=0
+
+" Default size of window
+set columns=9999
+set lines=999
+
+" Tab headings
+set gtl=%t gtt=%F
+
+function GuiTabLabel()
+ let label = ''
+ let bufnrlist = tabpagebuflist(v:lnum)
+
+ " 如果标签页里的窗口数目多于一,加上窗口数目
+ let labelnum = ''
+ let wincount = tabpagewinnr(v:lnum, '$')
+ if wincount > 1
+ let labelnum .= wincount
+ endif
+ if labelnum != ''
+ let labelnum = '[' . labelnum . ']'
+ endif
+
+ " 如果标签页里有修改过的缓冲区,加上 '+'
+ let is_labelmodified = ''
+ for bufnr in bufnrlist
+ if getbufvar(bufnr, "&modified")
+ let is_labelmodified = '*'
+ break
+ endif
+ endfor
+
+ let label = labelnum . is_labelmodified
+
+ if label != ''
+ let label = ' ' . label
+ endif
+
+ " 附加缓冲区名
+ let filename = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
+ let shortname = fnamemodify(filename, ":t")
+ return v:lnum . ' ' . shortname . label
+endfunction
+
+set guitablabel=%{GuiTabLabel()}
+
+nmap <C-n> gt
+nmap <C-]> gt
+nmap <C-p> gT
+nmap <C-[> gT
View
@@ -9,8 +9,9 @@
" | jj = <esc> Very useful for keeping your hands on the home row |
" | ,n = toggle NERDTree off and on |
" | |
-" | ,f = fuzzy find all files |
-" | ,b = fuzzy find in all buffers |
+" | ",f = fuzzy find all files |
+" | ",b = fuzzy find in all buffers |
+" | ,f = toggle tag list window |
" | |
" | hh = inserts '=>' |
" | aa = inserts '@' |
@@ -19,7 +20,9 @@
" | ,v = new vertical window |
" | |
" | ,i = toggle invisibles |
-" | | " | enter and shift-enter = adds a new line after/before the current line |
+" | ,, = set nohlsearch |
+" | |
+" | enter and shift-enter = adds a new line after/before the current line |
" | |
" | :call Tabstyle_tabs = set tab to real tabs |
" | :call Tabstyle_spaces = set tab to 2 spaces |
@@ -123,6 +126,10 @@ imap aa @
imap <up> <C-o>gk
imap <down> <C-o>gj
imap .. ->
+map <S-Enter> O<Esc>
+map <CR> o<Esc>
+nmap <silent> <Leader>h :vsplit<CR>
+nmap <silent> <Leader>v :split<CR>
" 选中后按/向后(?向前)直接搜索
vmap / y/<C-R>"<CR>
@@ -340,6 +347,7 @@ let b:did_jslint_plugin = 1
" Align settings
let g:Align_xstrlen = 3 "handle multibyte characters :h align-strlen
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Function define
"""""""""""""""""""""""""""""""""""""""""""""""""""""""

0 comments on commit 5ce036f

Please sign in to comment.