2 "@Modified: 2012-Aug-31-13-20
5 "set nocompatible "because this is defined in vimrc_example.vim
7 "source $VIMRUNTIME/vimrc_example.vim
8 set fileformats=unix,dos
13 ""language time English_United States.1252
14 ""set langmenu=en.UTF-8
16 set fencs=ucs-bom,utf-8,gb2312,gb18030,gbk,big5,l439atin1
17 "set fencs=ucs-bom,utf-8,cp936,gb18030,gbk,big5,euc-jp,euc-kr,latin1
18 "set fencs=ucs-bom,utf-8,gb2312,gbk,gb18030,latin1
19 "set fencs=ucs-bom,chinese,taiwan,japan,korea,utf-8,latin1
26 let $VIMFILY=expand("$HOME") . '/.vim'
27 "let mac option key work as meta key in vim
30 if has("gui_running") "for gdk+ vim seting
34 "source $VIMRUNTIME/delmenu.vim
35 "source $VIMRUNTIME/menu.vim
36 "set imactivatekey=C-space
39 "inoremap <esc> <esc>:set iminsert=2<cr>
40 "noremap i :set iminsert=2<cr>i
41 "noremap a :set iminsert=2<cr>a
45 " CTRL-A is Select all
46 noremap <C-A> gggH<C-O>G
47 inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
48 cnoremap <C-A> <C-C>gggH<C-O>G
49 onoremap <C-A> <C-C>gggH<C-O>G
50 snoremap <C-A> <C-C>gggH<C-O>G
51 xnoremap <C-A> <C-C>ggVG
53 " CTRL-V and SHIFT-Insert are Paste
58 cmap <S-Insert> <C-R>*
59 else "for bash vim setting
64 "let $VIMFILY='~/.vim'
65 let $VIMFILY=expand("$HOME") . '/.vim'
67 "source ~/vimfiles/filetype.vim
68 else "for win32 setting
70 "source $VIMRUNTIME/mswin.vim
71 "set guioptions+=a "auto copy to
73 set grepprg=grep\ -n\ $*\ /dev/null
74 set grepformat=%f:%l:%m,%f:%l%m,%f\ %l%m
75 cabbrev sort /bin/sort
79 let $VIMFILY=expand("$HOME") . '/vimfiles'
82 let $ADDED=$VIMFILY . '/added_plugin'
84 source $ADDED/my_vimrc_example.vim
85 if has("win32") && has("gui_running")
86 source $ADDED/my_mswin.vim
89 source $ADDED/publib.vim
92 let $ADDED2=$VIM . '/vimfiles/added_plugin2'
97 """"""""""""""""""""""""""""""""""""""""""""""""""""""
99 """""""""""""""""""""""""""""""""""""""""""""""""""""
101 set hh=999 "set the help windows defaul height to max
102 set linebreak "let english word break whole word
106 set viminfo='100,<1500,s500,:500,/300
110 set hid "let you can change buffer without save
112 "turn off ignorecase in a typed search if an uppercase char exists.
114 call CodeMode() "most time are coding:)
118 set guioptions-=T "hide the toolbar
119 set guioptions-=m "hide the menubar
120 "set guioptions+=c "use text dialog
124 "set rulerformat=%50(\ %n[%{&ff}]%r%m%y%=%-14.(%l,%c%V%)\ %p%%%)
125 "set statusline=%<%f %n[%{&ff}]%r%m%y%=%-14.(%l,%c%V%)\ %p%%
126 hi User1 term=standout,bold cterm=reverse ctermbg=red gui=bold guifg=red guibg=Grey
127 hi User2 term=standout,bold cterm=reverse gui=bold guibg=Grey
130 """""""""""""""""""""""""""""""""""""""""""""""""""""""
131 "function for return the file format and file encoding
132 "from http://msghost.iyublog.com/?cat=477
133 function! FunFileEncoding()
134 return &ff . ":" . &fenc
136 """"""""""""""""""""""""""""""""""""""""""""""""""
138 set statusline=%2*%=\ \ \ %50(%f\ @%n[%{FunFileEncoding()}]%r%m%y#%{changenr()}%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
141 set listchars+=tab:>-
142 set wildmenu "用tab在命令行提示
143 "set clipboard+=unnamed "是y 和 p 同系统剪切板相连
144 set clipboard+=autoselect
145 "set splitbelow "splitting a window below the current one
146 """""""""""""""""""""""""""""""""""""""""""""""""""""
148 """""""""""""""""""""""""""""""""""""""""""""""""""""
150 if has("mac") || has("macunix")
151 set backupdir=/Volumes/hard/backups/vi
154 set backupdir=/var/backups/vi
156 if($MYGENV == "true")
157 set backupdir=$E_DISK//var/backups/vi
159 set backupdir=e:/var/backups/vi
163 "set sessionoptions+=curdir
165 set backupskip+=*.clean,cvscommit.????,*.~
166 set wildignore=*.o,*.obj,*.exe,*.bak,*.clean
167 if has("gui_running")
168 let savevers_dirs = &backupdir
170 source $ADDED/savevers.vim
175 "change the direct when chang the buffer
176 "au BufEnter * :lcd %:p:h
181 set titlestring=%<%F\ %M\ %R\ %{v:servername}\ %{mode()}
183 """""""""""""""""""""""""""""""""""""""""""""""""""""
186 """"""""""""""""""""""""""""""""""""""""""""""""""""""
187 """""""""""""""""""""""""""""""""""""""""""""""""""""
188 " Text Formatting/Layout
189 """""""""""""""""""""""""""""""""""""""""""""""""""""
191 """""""""""""""""""""""""""""""""""""""""""""""""""""
193 """""""""""""""""""""""""""""""""""""""""""""""""""""
194 set foldenable " Turn on folding
195 "set foldmethod=indent " Make folding indent sensitive
196 set foldlevel=100 " Don't autofold anything (but I can still fold manually)
197 "set foldopen-=search " don't open folds when you search into them
200 "set foldmethod=syntax
202 " setting for xml plugin
203 let g:xml_syntax_folding = 1
204 let xml_use_xhtml = 1
205 "let xml_jump_string = '<!-- mark -->'
210 """""""""""""""""""""""""""""""""""""""""""""""""""""
212 """""""""""""""""""""""""""""""""""""""""""""""""""""
214 "nnoremap <C-i> i <esc>r
222 "for del the auto comment
223 noremap <m-cr> o<esc>^"8d$a
225 "for eclipse compatible
226 inoremap <m-/> <c-x><c-o>
228 "for good insert next line
230 noremap <m-i> :let g:currentline=line('.')<cr>:.d<cr>:if g:currentline==line('.')<cr>:normal -<cr>:endif<cr>o
232 "use <c-v> to mapping the block visual mode do not using the win32 paste
235 "nnoremap <silent> <cr> i<cr><esc>
239 "notice, <c-e> using for end complete mode, <c-y> using for accept complete in
243 "inoremap <A-r> <C-R>
244 "inoremap <C-u> <esc>g-a
245 "inoremap <C-r> <esc>g+a
246 inoremap <C-u> <C-O>u
247 "inoremap <C-z> <C-O>u
248 inoremap <C-r> <C-O><C-R>
253 let g:gundo_width = 60
254 let g:gundo_preview_height = 12
255 let g:gundo_right = 1
256 "let g:gundo_close_on_revert = 1
258 noremap <silent> <m-;> :silent GundoToggle<cr>
259 inoremap <silent> <m-;> <esc>:silent GundoToggle<cr>
260 noremap <silent> <m-:> <esc>:silent GundoRenderGraph<cr>
261 inoremap <silent> <m-:> <esc>:silent GundoRenderGraph<cr>
262 """"""""""""""""""""""""""""""""
264 " my window key map setting
266 inoremap <a-j> <c-w>w
267 "noremap <a-h> <c-w>h
268 "inoremap <a-h> <c-w>h
269 "noremap <a-l> <c-w>l
270 "inoremap <a-l> <c-w>l
271 "noremap <a-j> <c-w>j
272 "inoremap <a-j> <c-w>j
273 "noremap <a-k> <c-w>k
274 "inoremap <a-k> <c-w>k
275 """"""""""""""""""""""""""""""""
277 " my complete setting
278 " failure try, must find a way to map /
279 "inoremap / <kDivide>
280 "imap <expr> <F3> "\u611B"
281 "inoremap <Right> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>
283 "like in emacs to kill a line
284 inoremap <C-k> <space><esc>d$a
286 "for del the auto comment
287 inoremap <m-cr> <cr><esc>^d$a
289 " reproduce previous line word by word
290 "inoremap <C-j> @@@<ESC>hhkyWjl?@@@<CR>P/@@@<CR>3s
293 " Put string marked by visual mode as default for search commands / and ?
294 " Warning: extending the marked text by searching doesn't work any more.
295 vnoremap / y/<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
296 vnoremap ? y?<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
298 " substitute(@",..) - remove lines after first, if >1 line highlighted
299 " escape(..) - put '\' before all characters meaningful in regexp's
300 " y - yank current selection (in register ")
301 " ctrl-r = .. <cr> - put expression after / as earch string
302 " credits go to Stefan Roemer and Peppe (Preben Guldberg).
304 " Remove whitespace from lines containing nothing else (grr to all nedit users)
306 "for the mouse conflict key(c-insert) of HP notebook
307 "noremap <Insert> <Esc>
308 "noremap <C-Insert> <Esc>
309 "inoremap <Insert> <Down>
310 "inoremap <C-Insert> <Down>
314 "for new tab page setting
315 map <leader>ta <esc>:tab sball<cr>
318 map <leader>bp <esc>:bp<return>
319 map <leader>bn <esc>:bn<return>
320 map <leader>bl <esc>:ls!<cr>
322 nnoremap <leader>dd <esc>:call MyTriggerMore()<cr>
323 map <leader>yy <esc>^"*y$
325 "editor setting mapping
326 map <leader>ec <esc>:call MyCoding()<cr>
327 map <leader>el <esc>:set list!<cr>
328 map <leader>em <esc>:call MyMenu()<cr>
329 map <leader>en <esc>:set nu!<cr>:set cursorline!<cr>
330 map <leader>ew <esc>:call MyWrap()<cr>
332 "file or browser mapping
333 "map <leader>fx <esc>:Ex<cr>
334 "nnoremap <leader>fd :set fileformat=dos<cr>
335 "nnoremap <leader>fu :set fileformat=unix<cr>
336 "map <leader>ww <esc>:call MyUrl(expand('<cWORD>'))<cr>
337 "map <leader>m <esc>:silent MarksBrowser<cr>
340 map <leader>sh <esc>:set hlsearch!<cr>
341 map <leader>sn <esc>:%s//&/gn<cr>
344 map <leader>ss <esc>:setlocal spell!<cr>
346 "ca xsp write !aspell -a --lang="en_US"<cr>
347 "map <leader>s <Esc>:w<cr><Esc>:!aspell -c --dont-backup --lang=en_US "%:p"<cr>:e! "%"<cr><cr>
349 "map <leader>df <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Dictionary?book=Dictionary&va=<cword>"<cr><cr>
350 "map <leader>dF <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Thesaurus?book=Thesaurus&va=<cword>"<cr><cr>
351 "map <leader>dW <esc>:silent !wnb <cword> <cr><cr>
353 "for new tab setting and new align setting
354 " leader mode mapping
355 map <leader>la <esc>:call SecondLoadAlign()<cr>
356 map <leader>lt <esc>:call SecondTriggerChangeTab()<cr>
358 " remove space and enter charactor
359 map <leader>rs <esc>::%s= *$==<cr>
360 map <leader>rd <esc>:%s/\r//g<cr>
363 "MAKE IT EASY TO UPDATE/RELOAD_vimrc
364 nnoremap <leader>-s <esc>:source ~/_vimrc<cr>
365 nnoremap <leader>-v <esc>:e ~/_vimrc<cr>
367 " trigger color style
369 "if has("gui_running") "for gdk+ vim seting
370 map <leader>cd <esc>:call MyTriggerColor()<cr>
374 """""""""""""""""""""""""""""""""""""""""""""""""""""
375 " <F5>-<F8>maping for savers-pluging
376 " <F5> decrease version viewed in VersDiff window
377 " <F6> increase version viewed in VersDiff window
378 " <F7> do VersDiff with cvs version of current file
379 " <F8> cancel VersDiff window
380 nmap <silent> <F3> :VersDiff -<cr>
381 nmap <silent> <F4> :VersDiff +<cr>
382 """""""""""""""""""""""""""""""""""""""""""""""""""""
384 " for autohotkey to using:)
385 " 0=english input 1=chinese input
390 com! MM call MyMore()
391 com! MLOG call MyLog()
392 """""""""""""""""""""""""""""""""""""""""""""""""""""
394 """""""""""""""""""""""""""""""""""""""""""""""""""""
395 "Programmings abbrevs
396 """""""""""""""""""""""""""""""""""""""""""""""""""""
397 """""""""""""""""""""""""""""""""""""""""""""""""""""
398 "Informational abbrevs
399 """""""""""""""""""""""""""""""""""""""""""""""""""""
400 "iab xda <c-r>=strftime("%Y-%m-%d-%H:%M:%S")<cr>
401 iab xda <c-r>=substitute(system("date +%Y-%m-%d-%H:%M"),"\n","","")<cr>
405 iabbrev synchronisation
415 """""""""""""""""""""""""""""""""""""""""""""""""""""
418 """""""""""""""""""""""""""""""""""""""""""""""""""""
419 "for no swap attation
423 if v:statusmsg =~ '\.sw[^p]$'
424 set statusline=%2*%=\ \ \ %50(%f\ @%n%*%1*[$]%*%2*[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
427 set statusline=%2*%=\ \ \ %50(%f\ @%n[%{FunFileEncoding()}]%r%m%y#%{changenr()}%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
428 "set statusline=%2*%=\ \ \ %50(%f\ @%n[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c%V%)\ %p%%%)%*
434 autocmd BufEnter * silent call CheckSwap()
436 """""""""""""""""""""""""""""""""""""""""""""""""""""
441 """""""""""""""""""""""""""""""""""""""""""""""""""""
443 """""""""""""""""""""""""""""""""""""""""""""""""""""
444 "let g:vikiUseParentSuffix = 1
445 "let g:vikiSpecialFiles='jpg\|gif\|bmp\|pdf\|dvi\|ps\|eps\|png\|jpeg\|wmf\|otl'
446 "let g:vikiOpenFileWith_otl = 'silent !D:/prog/Natara/Bonsai/Bonsai.exe %{FILE}'
448 " we want to allow deplate to execute ruby code and external helper
450 "let g:deplatePrg = "deplate -x -X "
451 "au FileType viki compiler deplate
452 "let g:vikiInterOLM= $HOME ."/olm"
453 "let g:vikiInterOLM_suffix= ".olm"
454 "let g:vikiInterHW= $HOME ."/viki"
455 "let g:vikiInterHW_suffix= ".txt"
460 """""""""""""""""""""""""""""""""""""""""""""""""""""
462 map <leader>rr :MRU<cr>gg
463 let MRU_Max_Entries = 500
464 let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*|^c:\\temp\\.*'
465 let MRU_File = $VIMFILY . "/_vim_mru_files"
466 "let MRU_Auto_Close = 0 " to keep the mru window
467 """""""""""""""""""""""""""""""""""""""""""""""""""""
469 """""""""""""""""""""""""""""""""""""""""""""""""""""
470 " setting for subversion
471 nmap <leader>va <Plug>VCSAdd
472 nmap <leader>vn <Plug>VCSAnnotate
473 nmap <leader>vc <Plug>VCSCommit
474 nmap <leader>vd <Plug>VCSDiff
475 nmap <leader>ve <Plug>VCSEdit
476 nmap <leader>vi <Plug>VCSEditors
477 nmap <leader>vg <Plug>VCSGotoOriginal
478 nmap <leader>vG <Plug>VCSGotoOriginal!
479 nmap <leader>vl <Plug>VCSLog
480 nmap <leader>vr <Plug>VCSReview
481 nmap <leader>vs <Plug>VCSStatus
482 nmap <leader>vt <Plug>VCSUnedit
483 nmap <leader>vu <Plug>VCSUpdate
484 nmap <leader>vv <Plug>VCSVimDiff
485 nmap <leader>vwv <Plug>VCSWatchers
486 nmap <leader>vwa <Plug>VCSWatchAdd
487 nmap <leader>vwn <Plug>VCSWatchOn
488 nmap <leader>vwf <Plug>VCSWatchOff
489 nmap <leader>vwf <Plug>VCSWatchRemove
490 """""""""""""""""""""""""""""""""""""""""""""""""""""
493 """""""""""""""""""""""""""""""""""""""""""""""""""""
495 """""""""""""""""""""""""""""""""""""""""""""""""""""
496 "autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
497 "autocmd BufEnter * :lcd %:p:h " switch to current dir
498 "autocmd GUIEnter * :simalt ~x " maximize the screen
500 augroup filetypedetect
501 """""""""""""""""""""""""""""""""""""""""""""""""""""
502 "for help and readbale file mode
503 augroup! filetypedetect
504 autocmd FileType help call MyMore()
505 """""""""""""""""""""""""""""""""""""""""""""""""""""
507 """""""""""""""""""""""""""""""""""""""""""""""""""""
508 "for the make error windows quickfix windows
509 au BufReadPost quickfix set modifiable
510 au BufReadPost quickfix silent g/^/s//\=line(".")." "/
511 autocmd FileType qf call MyMore()
512 """""""""""""""""""""""""""""""""""""""""""""""""""""
514 """""""""""""""""""""""""""""""""""""""""""""""""""""
516 """""""""""""""""""""""""""""""""""""""""""""""""""""
517 "autocmd BufNewFile *.sh 0r ~/vimtemplate/skeleton.sh
518 "autocmd BufNewFile *.vim 0r $HOME/vimfiles/skel/vim.skel
519 autocmd BufNewFile,BufReadPre *.java,*.vim,*.sh,*.html,*.xhtml,*.py source $ADDED/skel.vim
520 "autocmd BufNewFile *.java 0r $VIMFILY/skel/java.skel
521 "autocmd BufNewFile *.vim 0r $VIMFILY/skel/vim.skel
522 "autocmd BufNewFile *.sh 0r $VIMFILY/skel/sh.skel
523 "autocmd BufNewFile *.html 0r $VIMFILY/skel/html.skel
524 "autocmd BufNewFile *.xhtml 0r $VIMFILY/skel/xhtml.skel
525 "autocmd BufNewFile *.java,*.vim,*.sh,*.html,*.xhtml call Replacy()
526 """""""""""""""""""""""""""""""""""""""""""""""""""""
527 """""""""""""""""""""""""""""""""""""""""""""""""""""
529 "au BufReadPre *.doc set ro
530 "au BufReadPre *.doc set hlsearch!
531 "au BufReadPost *.doc silent %!antiword "%"
532 "autocmd BufReadPost *.doc silent %!wvware "%"
533 """""""""""""""""""""""""""""""""""""""""""""""""""""
534 "au BufNewFile,BufRead /home/Administrator/std-java/new1.5/* let g:bnojikes=1
536 autocmd BufWritePre,FileWritePre *.vim,_vimrc ks|call LastMod()|'s
537 autocmd BufWritePre,FileWritePre *.jsp,*.html ks|call LastMod2()|'s
539 autocmd BufNewFile,BufreadPre *.text,*.wiki call TextMode()
540 "autocmd BufNewFile,BufreadPre *.rst call RstMode()
541 autocmd FileType vim setlocal complete=.,k~/dic/vimdiction,w,b,u,i
543 autocmd fileType ahk source $ADDED/bracket.vim
546 """""""""""""""""""""""""""""""""""""""""""""""""""""
548 """""""""""""""""""""""""""""""""""""""""""""""""""""
549 nnoremap <silent> <F8> :Tlist<cr>
550 let Tlist_Show_One_File = 1 " just show tag of current files
551 let Tlist_Exit_OnlyWindow = 1 " if taglist window iis the last one then exit vim
552 let Tlist_File_Fold_Auto_Close=1 " auto fold not editing function list
553 let Tlist_Sort_Type = "name" " order by
554 let Tlist_Use_Right_Window = 1 " split to the right side of the screen
555 let tlist_dosini_settings= 'ini;r:respect'
556 let tlist_html_settings = 'html;a:anchor;f:javascript function;u:url'
557 let tlist_vb_settings= 'vb;t:type;s:sub;f:function'
558 let tlist_ant_settings = 'ant;p:Project;r:Property;t:Target'
559 let JavaBrowser_Use_SingleClick = 0
560 let JavaBrowser_Use_Right_Window = 1
561 let JavaBrowser_Use_Icon = 0
562 let JavaBrowser_Compact_Format = 1
563 let JavaBrowser_Expand_Tree_At_Startup = 1
567 """""""""""""""""""""""""""""""""""""""""""""""""""""
569 """""""""""""""""""""""""""""""""""""""""""""""""""""
570 let g:JavaImpPaths = $JAVALIB."/j2sdk1.5_src,".$JAVALIB."junit_src,".$VIMFILY."/JavaImp/jmplst"
571 let g:JavaImpDataDir = $VIMFILY."/JavaImp"
572 let g:JavaImpDocPaths= $JAVA_DOCPATH
573 let g:JavaImpDocViewer = "viewHtml"
577 """""""""""""""""""""""""""""""""""""""""""""""""""""
579 """""""""""""""""""""""""""""""""""""""""""""""""""""
580 let g:favex_ff='<leader>fa'
581 let g:favex_fd='<leader>fA'
582 """""""""""""""""""""""""""""""""""""""""""""""""""""
584 """""""""""""""""""""""""""""""""""""""""""""""""""""
585 """""""""""""""""""""""""""""""""""""""""""""""""""""
588 au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr>
590 "let g:VCSCommandEdit= 'spilt'
592 """""""""""""""""""""""""""""""""""""""""""""""""""""
594 """""""""""""""""""""""""""""""""""""""""""""""""""""
596 """""""""""""""""""""""""""""""""""""""""""""""""""""
597 "let g:bufExplorerDetailedHelp=1
598 let g:netrw_keepdir=0
599 let g:netrw_cygwin= 1
600 let g:netrw_longlist=1
601 let g:netrw_sort_by="time"
602 let g:netrw_sort_direction="reverse"
603 let g:netrw_timefmt=" %Y %m %d\t%H:%M"
604 let g:netrw_winsize=25
606 """""""""""""""""""""""""""""""""""""""""""""""""""""
608 """""""""""""""""""""""""""""""""""""""""""""""""""""
609 "nmap <silent> <unique> <leader>be <Plug>SelectBuf
610 "nmap <unique> <leader>bl <Plug>SelBufLaunchCmd
611 "let selBufAlwaysShowHidden=0
612 "let selBufIgnoreNonFileBufs=0
615 "nmap <Leader>tv :call TabLineSet_verbose_toggle()<CR>
616 "nmap <Leader>tr :call TabLineSet_verbose_rotate()<CR>
617 "nmap <silent> <Leader>w :call WinWalkerMenu()<CR>
623 "Highlight space at end of line as error
624 "highlight WhitespaceEOL ctermbg=darkred guibg=darkred
625 "match WhitespaceEOL /\s\+$/
631 "set diffexpr=MyDiff()
633 " let opt = '-a --binary '
634 " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
635 " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
636 " let arg1 = v:fname_in
637 " if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
638 " let arg2 = v:fname_new
639 " if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
640 " let arg3 = v:fname_out
641 " if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
642 " silent execute '!e:\prog\Vim\vim63\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
646 function! MyTabLabel(n)
647 let buflist = tabpagebuflist(a:n)
648 let winnr = tabpagewinnr(a:n)
649 return bufname(buflist[winnr - 1])
652 function! MyTabLine()
654 for i in range(tabpagenr('$'))
655 " select the highlighting
656 if i + 1 == tabpagenr()
657 let s .= '%#TabLineSel#'
659 let s .= '%#TabLine#'
662 " set the tab page number (for mouse clicks)
663 let s .= '%' . (i + 1) . 'T'
665 " the label is made by MyTabLabel()
666 let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
669 " after the last tab fill with TabLineFill and reset tab page nr
670 let s .= '%#TabLineFill#%T'
672 " right-align the label to close the current tab page
673 if tabpagenr('$') > 1
674 let s .= '%=%#TabLine#%999Xclose'
680 function! GuiTabLabel()
682 "let bufnrlist = tabpagebuflist(v:lnum)
684 " Add '+' if one of the buffers in the tab page is modified
685 "for bufnr in bufnrlist
686 "if getbufvar(bufnr, "&modified")
692 " Append the number of windows in the tab page if more than one
693 "let wincount = tabpagewinnr(v:lnum, '$')
695 "let label .= wincount
697 if v:lnum == g:currentPage
702 " Append the buffer name
705 function! GuiTabLabel2()
707 let bufnrlist = tabpagebuflist(v:lnum)
709 " Add '+' if one of the buffers in the tab page is modified
710 "for bufnr in bufnrlist
711 "if getbufvar(bufnr, "&modified")
717 " Append the number of windows in the tab page if more than one
718 if v:lnum == g:currentPage
721 let wincount = tabpagewinnr(v:lnum, '$')
723 let label .= wincount
729 function! GuiTabLabelEnter()
730 let g:currentPage=tabpagenr()
731 set guitablabel=%{GuiTabLabel()}%N\ %t\ %{GuiTabLabel2()}
734 function! GuiTabLabelLeave()
737 " the tab setting and mapping
739 "set guitablabel=%N\ %f
740 "set guitablabel=%{GuiTabLabel()}
742 "set guitablabel=%N/\ %t\ %M
743 set tabline=%!MyTabLine()
745 map <silent><F12> :if g:toggleTabs == 1<CR>:tabo<CR>:set lines+=3<CR>:let g:toggleTabs = 0<CR>:else<CR>:set lines-=3<CR>:tab ball<CR>:let g:toggleTabs = 1<CR>:endif<CR>
746 map <silent><C-tab> :if g:toggleTabs == 1<CR>:tabnext<CR>:else<CR>:bn<CR>:endif<CR>
747 map <silent><C-S-tab> :if g:toggleTabs == 1<CR>:tabprevious<CR>:else<CR>:bp<CR>:endif<CR>
749 map <leader>tt <esc>:tabnew<cr>:let g:toggleTabs=1<cr>
750 map <leader>tx :tabclose<cr>:if tabpagenr("$") == 1<cr>let g:toggleTabs=0<cr>:endif<cr><cr>
751 map <leader>tm :tabmove
752 map <leader>tn :tabnext <cr>
753 map <leader>tp :tabprevious <cr>
754 "map <C-Tab> :tabn <CR>
755 "map <C-S-Tab> :tabp <CR>
758 autocmd TabEnter * call GuiTabLabelEnter()
762 if has("gui_running")
763 function! InfoGuiTooltip()
765 let wincount = tabpagewinnr(tabpagenr(),'$')
767 "get name of active buffers in windows
768 for i in tabpagebuflist()
769 let bufferlist .= '['.fnamemodify(bufname(i),':t')."]"
771 return bufname($).'-'.bufferlist
773 set guitabtooltip=%!InfoGuiTooltip()
776 function! FoldSpellBalloon()
777 let foldStart = foldclosed(v:beval_lnum )
778 let foldEnd = foldclosedend(v:beval_lnum)
780 " Detect if we are in a fold
782 " Detect if we are on a misspelled word
783 let lines = spellsuggest( spellbadword(v:beval_text)[ 0 ], 5, 0 )
786 let numLines = foldEnd - foldStart + 1
787 " if we have too many lines in fold, show only the first 14
788 " and the last 14 lines
790 let lines = getline( foldStart, foldStart + 14 )
791 let lines += [ '-- Snipped ' . ( numLines - 30 ) . ' lines --' ]
792 let lines += getline( foldEnd - 14, foldEnd )
794 "less than 30 lines, lets show all of them
795 let lines = getline( foldStart, foldEnd )
799 return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
801 set balloonexpr=FoldSpellBalloon()
808 let g:vimim_chinese_punctuation=0
811 let jslint_highlight_color = 'yellow'
816 set csprg=/usr/local/bin/cscope
818 set csprg=/usr/local/bin/cscope
819 "set csprg=/usr/bin/mlcscope
821 set csprg=%CYGWIN_HOME%\bin\\mlcscope.exe
824 " for clipbord conflict with NERD
825 nmap <unique> <silent> <Leader>co <Plug>ClipBrdOpen
827 " add my highlight setting
828 call MyColorSetting()
830 " for pathogen vim runtime path manager
831 call pathogen#infect()
836 "let g:user_zen_leader_key = "<c-\=>"
838 " for the missing pop up complete frame conflic with enter key
839 inoremap <expr><Enter> pumvisible() ? "\<C-Y>" : "\<Enter>"