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
23 if has("gui_running") "for gdk+ vim seting
27 "source $VIMRUNTIME/delmenu.vim
28 "source $VIMRUNTIME/menu.vim
29 "set imactivatekey=C-space
32 "inoremap <esc> <esc>:set iminsert=2<cr>
33 "noremap i :set iminsert=2<cr>i
34 "noremap a :set iminsert=2<cr>a
38 " CTRL-A is Select all
39 noremap <C-A> gggH<C-O>G
40 inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
41 cnoremap <C-A> <C-C>gggH<C-O>G
42 onoremap <C-A> <C-C>gggH<C-O>G
43 snoremap <C-A> <C-C>gggH<C-O>G
44 xnoremap <C-A> <C-C>ggVG
46 " CTRL-V and SHIFT-Insert are Paste
51 cmap <S-Insert> <C-R>*
52 else "for bash vim setting
57 "let $VIMFILY='~/.vim'
58 let $VIMFILY=expand("$HOME") . '/.vim'
60 "source ~/vimfiles/filetype.vim
61 else "for win32 setting
63 "source $VIMRUNTIME/mswin.vim
64 "set guioptions+=a "auto copy to
66 set grepprg=grep\ -n\ $*\ /dev/null
67 set grepformat=%f:%l:%m,%f:%l%m,%f\ %l%m
68 cabbrev sort /bin/sort
72 let $VIMFILY=expand("$HOME") . '/vimfiles'
75 let $ADDED=$VIMFILY . '/added_plugin'
77 source $ADDED/my_vimrc_example.vim
78 if !has("unix") && has("gui_running")
79 source $ADDED/my_mswin.vim
82 source $ADDED/publib.vim
85 let $ADDED2=$VIM . '/vimfiles/added_plugin2'
90 """"""""""""""""""""""""""""""""""""""""""""""""""""""
92 """""""""""""""""""""""""""""""""""""""""""""""""""""
94 set hh=999 "set the help windows defaul height to max
95 set linebreak "let english word break whole word
99 set viminfo='100,<1500,s500,:500,/300
103 set hid "let you can change buffer without save
105 "turn off ignorecase in a typed search if an uppercase char exists.
107 call CodeMode() "most time are coding:)
111 set guioptions-=T "hide the toolbar
112 set guioptions-=m "hide the menubar
113 "set guioptions+=c "use text dialog
117 "set rulerformat=%50(\ %n[%{&ff}]%r%m%y%=%-14.(%l,%c%V%)\ %p%%%)
118 "set statusline=%<%f %n[%{&ff}]%r%m%y%=%-14.(%l,%c%V%)\ %p%%
119 hi User1 term=standout,bold cterm=reverse ctermbg=red gui=bold guifg=red guibg=Grey
120 hi User2 term=standout,bold cterm=reverse gui=bold guibg=Grey
123 """""""""""""""""""""""""""""""""""""""""""""""""""""""
124 "function for return the file format and file encoding
125 "from http://msghost.iyublog.com/?cat=477
126 function! FunFileEncoding()
127 return &ff . ":" . &fenc
129 """"""""""""""""""""""""""""""""""""""""""""""""""
131 set statusline=%2*%=\ \ \ %50(%f\ @%n[%{FunFileEncoding()}]%r%m%y#%{changenr()}%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
134 set listchars+=tab:>-
135 set wildmenu "用tab在命令行提示
136 "set clipboard+=unnamed "是y 和 p 同系统剪切板相连
137 set clipboard+=autoselect
138 "set splitbelow "splitting a window below the current one
139 """""""""""""""""""""""""""""""""""""""""""""""""""""
141 """""""""""""""""""""""""""""""""""""""""""""""""""""
144 set backupdir=/var/backups/vi
146 if($MYGENV == "true")
147 set backupdir=$E_DISK//var/backups/vi
149 set backupdir=e:/var/backups/vi
153 "set sessionoptions+=curdir
155 set backupskip+=*.clean,cvscommit.????,*.~
156 set wildignore=*.o,*.obj,*.exe,*.bak,*.clean
157 if has("gui_running")
158 let savevers_dirs = &backupdir
160 source $ADDED/savevers.vim
165 "change the direct when chang the buffer
166 "au BufEnter * :lcd %:p:h
171 set titlestring=%<%F\ %M\ %R\ %{v:servername}\ %{mode()}\ e\ U
173 """""""""""""""""""""""""""""""""""""""""""""""""""""
176 """"""""""""""""""""""""""""""""""""""""""""""""""""""
177 """""""""""""""""""""""""""""""""""""""""""""""""""""
178 " Text Formatting/Layout
179 """""""""""""""""""""""""""""""""""""""""""""""""""""
181 """""""""""""""""""""""""""""""""""""""""""""""""""""
183 """""""""""""""""""""""""""""""""""""""""""""""""""""
184 set foldenable " Turn on folding
185 "set foldmethod=indent " Make folding indent sensitive
186 set foldlevel=100 " Don't autofold anything (but I can still fold manually)
187 "set foldopen-=search " don't open folds when you search into them
190 "set foldmethod=syntax
191 let g:xml_syntax_folding = 1
192 let xml_use_xhtml = 1
197 """""""""""""""""""""""""""""""""""""""""""""""""""""
199 """""""""""""""""""""""""""""""""""""""""""""""""""""
201 "nnoremap <C-i> i <esc>r
209 "for del the auto comment
210 noremap <m-cr> o<esc>^"8d$a
212 "for eclipse compatible
213 inoremap <m-/> <c-x><c-o>
215 "for good insert next line
217 noremap <m-i> :let g:currentline=line('.')<cr>:.d<cr>:if g:currentline==line('.')<cr>:normal -<cr>:endif<cr>o
219 "use <c-v> to mapping the block visual mode do not using the win32 paste
222 "nnoremap <silent> <cr> i<cr><esc>
226 "notice, <c-e> using for end complete mode, <c-y> using for accept complete in
230 "inoremap <A-r> <C-R>
231 "inoremap <C-u> <esc>g-a
232 "inoremap <C-r> <esc>g+a
233 inoremap <C-u> <C-O>u
234 "inoremap <C-z> <C-O>u
235 inoremap <C-r> <C-O><C-R>
240 let g:gundo_width = 60
241 let g:gundo_preview_height = 12
242 let g:gundo_right = 1
243 "let g:gundo_close_on_revert = 1
245 noremap <silent> <m-;> :silent GundoToggle<cr>
246 inoremap <silent> <m-;> <esc>:silent GundoToggle<cr>
247 noremap <silent> <m-:> <esc>:silent GundoRenderGraph<cr>
248 inoremap <silent> <m-:> <esc>:silent GundoRenderGraph<cr>
249 """"""""""""""""""""""""""""""""
251 " my window key map setting
253 inoremap <a-j> <c-w>w
254 "noremap <a-h> <c-w>h
255 "inoremap <a-h> <c-w>h
256 "noremap <a-l> <c-w>l
257 "inoremap <a-l> <c-w>l
258 "noremap <a-j> <c-w>j
259 "inoremap <a-j> <c-w>j
260 "noremap <a-k> <c-w>k
261 "inoremap <a-k> <c-w>k
262 """"""""""""""""""""""""""""""""
264 " my complete setting
265 " failure try, must find a way to map /
266 "inoremap / <kDivide>
267 "imap <expr> <F3> "\u611B"
268 "inoremap <Right> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>
270 "like in emacs to kill a line
271 inoremap <C-k> <space><esc>d$a
273 "for del the auto comment
274 inoremap <m-cr> <cr><esc>^d$a
276 " reproduce previous line word by word
277 "inoremap <C-j> @@@<ESC>hhkyWjl?@@@<CR>P/@@@<CR>3s
280 " Put string marked by visual mode as default for search commands / and ?
281 " Warning: extending the marked text by searching doesn't work any more.
282 vnoremap / y/<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
283 vnoremap ? y?<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
285 " substitute(@",..) - remove lines after first, if >1 line highlighted
286 " escape(..) - put '\' before all characters meaningful in regexp's
287 " y - yank current selection (in register ")
288 " ctrl-r = .. <cr> - put expression after / as earch string
289 " credits go to Stefan Roemer and Peppe (Preben Guldberg).
291 " Remove whitespace from lines containing nothing else (grr to all nedit users)
293 "for the mouse conflict key(c-insert) of HP notebook
294 noremap <Insert> <Esc>
295 noremap <C-Insert> <Esc>
296 inoremap <Insert> <Down>
297 inoremap <C-Insert> <Down>
301 "for new tab page setting
302 map <leader>ta <esc>:tab sball<cr>
305 map <leader>bp <esc>:bp<return>
306 map <leader>bn <esc>:bn<return>
307 map <leader>bl <esc>:ls!<cr>
309 nnoremap <leader>dd <esc>:call MyTriggerMore()<cr>
310 map <leader>yy <esc>^"*y$
312 "editor setting mapping
313 map <leader>ec <esc>:call MyCoding()<cr>
314 map <leader>el <esc>:set list!<cr>
315 map <leader>em <esc>:call MyMenu()<cr>
316 map <leader>en <esc>:set nu!<cr>:set cursorline!<cr>
317 map <leader>ew <esc>:call MyWrap()<cr>
319 "file or browser mapping
320 map <leader>fx <esc>:Ex<cr>
321 nnoremap <leader>fd :set fileformat=dos<cr>
322 nnoremap <leader>fu :set fileformat=unix<cr>
323 map <leader>ww <esc>:call MyUrl(expand('<cWORD>'))<cr>
324 map <leader>m <esc>:silent MarksBrowser<cr>
327 map <leader>sh <esc>:set hlsearch!<cr>
328 map <leader>sn <esc>:%s//&/gn<cr>
331 map <leader>ss <esc>:setlocal spell!<cr>
333 "ca xsp write !aspell -a --lang="en_US"<cr>
334 "map <leader>s <Esc>:w<cr><Esc>:!aspell -c --dont-backup --lang=en_US "%:p"<cr>:e! "%"<cr><cr>
336 "map <leader>df <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Dictionary?book=Dictionary&va=<cword>"<cr><cr>
337 "map <leader>dF <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Thesaurus?book=Thesaurus&va=<cword>"<cr><cr>
338 "map <leader>dW <esc>:silent !wnb <cword> <cr><cr>
340 "for new tab setting and new align setting
341 " leader mode mapping
342 map <leader>la <esc>:call SecondLoadAlign()<cr>
343 map <leader>lt <esc>:call SecondTriggerChangeTab()<cr>
345 " remove space and enter charactor
346 map <leader>rs <esc>::%s= *$==<cr>
347 map <leader>rd <esc>:%s/\r//g<cr>
350 "MAKE IT EASY TO UPDATE/RELOAD_vimrc
351 nnoremap <leader>-s <esc>:source ~/_vimrc<cr>
352 nnoremap <leader>-v <esc>:e ~/_vimrc<cr>
354 " trigger color style
356 "if has("gui_running") "for gdk+ vim seting
357 map <leader>cd <esc>:call MyTriggerColor()<cr>
361 """""""""""""""""""""""""""""""""""""""""""""""""""""
362 " <F5>-<F8>maping for savers-pluging
363 " <F5> decrease version viewed in VersDiff window
364 " <F6> increase version viewed in VersDiff window
365 " <F7> do VersDiff with cvs version of current file
366 " <F8> cancel VersDiff window
367 nmap <silent> <F3> :VersDiff -<cr>
368 nmap <silent> <F4> :VersDiff +<cr>
369 """""""""""""""""""""""""""""""""""""""""""""""""""""
371 " for autohotkey to using:)
372 " 0=english input 1=chinese input
377 com! MM call MyMore()
378 com! MLOG call MyLog()
379 """""""""""""""""""""""""""""""""""""""""""""""""""""
381 """""""""""""""""""""""""""""""""""""""""""""""""""""
382 "Programmings abbrevs
383 """""""""""""""""""""""""""""""""""""""""""""""""""""
384 """""""""""""""""""""""""""""""""""""""""""""""""""""
385 "Informational abbrevs
386 """""""""""""""""""""""""""""""""""""""""""""""""""""
387 "iab xda <c-r>=strftime("%Y-%m-%d-%H:%M:%S")<cr>
388 iab xda <c-r>=substitute(system("date +%Y-%m-%d-%H:%M"),"\n","","")<cr>
392 iabbrev synchronisation
402 """""""""""""""""""""""""""""""""""""""""""""""""""""
405 """""""""""""""""""""""""""""""""""""""""""""""""""""
406 "for no swap attation
410 if v:statusmsg =~ '\.sw[^p]$'
411 set statusline=%2*%=\ \ \ %50(%f\ @%n%*%1*[$]%*%2*[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
414 set statusline=%2*%=\ \ \ %50(%f\ @%n[%{FunFileEncoding()}]%r%m%y#%{changenr()}%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
415 "set statusline=%2*%=\ \ \ %50(%f\ @%n[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c%V%)\ %p%%%)%*
421 autocmd BufEnter * silent call CheckSwap()
423 """""""""""""""""""""""""""""""""""""""""""""""""""""
428 """""""""""""""""""""""""""""""""""""""""""""""""""""
430 """""""""""""""""""""""""""""""""""""""""""""""""""""
431 "let g:vikiUseParentSuffix = 1
432 "let g:vikiSpecialFiles='jpg\|gif\|bmp\|pdf\|dvi\|ps\|eps\|png\|jpeg\|wmf\|otl'
433 "let g:vikiOpenFileWith_otl = 'silent !D:/prog/Natara/Bonsai/Bonsai.exe %{FILE}'
435 " we want to allow deplate to execute ruby code and external helper
437 "let g:deplatePrg = "deplate -x -X "
438 "au FileType viki compiler deplate
439 "let g:vikiInterOLM= $HOME ."/olm"
440 "let g:vikiInterOLM_suffix= ".olm"
441 "let g:vikiInterHW= $HOME ."/viki"
442 "let g:vikiInterHW_suffix= ".txt"
447 """""""""""""""""""""""""""""""""""""""""""""""""""""
449 map <leader>rr :MRU<cr>gg
450 let MRU_Max_Entries = 500
451 let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*|^c:\\temp\\.*'
452 let MRU_File = $VIMFILY . "/_vim_mru_files"
453 "let MRU_Auto_Close = 0 " to keep the mru window
454 """""""""""""""""""""""""""""""""""""""""""""""""""""
456 """""""""""""""""""""""""""""""""""""""""""""""""""""
457 " setting for subversion
458 nmap <leader>va <Plug>VCSAdd
459 nmap <leader>vn <Plug>VCSAnnotate
460 nmap <leader>vc <Plug>VCSCommit
461 nmap <leader>vd <Plug>VCSDiff
462 nmap <leader>ve <Plug>VCSEdit
463 nmap <leader>vi <Plug>VCSEditors
464 nmap <leader>vg <Plug>VCSGotoOriginal
465 nmap <leader>vG <Plug>VCSGotoOriginal!
466 nmap <leader>vl <Plug>VCSLog
467 nmap <leader>vr <Plug>VCSReview
468 nmap <leader>vs <Plug>VCSStatus
469 nmap <leader>vt <Plug>VCSUnedit
470 nmap <leader>vu <Plug>VCSUpdate
471 nmap <leader>vv <Plug>VCSVimDiff
472 nmap <leader>vwv <Plug>VCSWatchers
473 nmap <leader>vwa <Plug>VCSWatchAdd
474 nmap <leader>vwn <Plug>VCSWatchOn
475 nmap <leader>vwf <Plug>VCSWatchOff
476 nmap <leader>vwf <Plug>VCSWatchRemove
477 """""""""""""""""""""""""""""""""""""""""""""""""""""
480 """""""""""""""""""""""""""""""""""""""""""""""""""""
482 """""""""""""""""""""""""""""""""""""""""""""""""""""
483 "autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
484 "autocmd BufEnter * :lcd %:p:h " switch to current dir
485 "autocmd GUIEnter * :simalt ~x " maximize the screen
487 augroup filetypedetect
488 """""""""""""""""""""""""""""""""""""""""""""""""""""
489 "for help and readbale file mode
490 augroup! filetypedetect
491 autocmd FileType help call MyMore()
492 """""""""""""""""""""""""""""""""""""""""""""""""""""
494 """""""""""""""""""""""""""""""""""""""""""""""""""""
495 "for the make error windows quickfix windows
496 au BufReadPost quickfix set modifiable
497 au BufReadPost quickfix silent g/^/s//\=line(".")." "/
498 autocmd FileType qf call MyMore()
499 """""""""""""""""""""""""""""""""""""""""""""""""""""
501 """""""""""""""""""""""""""""""""""""""""""""""""""""
503 """""""""""""""""""""""""""""""""""""""""""""""""""""
504 "autocmd BufNewFile *.sh 0r ~/vimtemplate/skeleton.sh
505 "autocmd BufNewFile *.vim 0r $HOME/vimfiles/skel/vim.skel
506 autocmd BufNewFile,BufReadPre *.java,*.vim,*.sh,*.html,*.xhtml,*.py source $ADDED/skel.vim
507 "autocmd BufNewFile *.java 0r $VIMFILY/skel/java.skel
508 "autocmd BufNewFile *.vim 0r $VIMFILY/skel/vim.skel
509 "autocmd BufNewFile *.sh 0r $VIMFILY/skel/sh.skel
510 "autocmd BufNewFile *.html 0r $VIMFILY/skel/html.skel
511 "autocmd BufNewFile *.xhtml 0r $VIMFILY/skel/xhtml.skel
512 "autocmd BufNewFile *.java,*.vim,*.sh,*.html,*.xhtml call Replacy()
513 """""""""""""""""""""""""""""""""""""""""""""""""""""
514 """""""""""""""""""""""""""""""""""""""""""""""""""""
516 "au BufReadPre *.doc set ro
517 "au BufReadPre *.doc set hlsearch!
518 "au BufReadPost *.doc silent %!antiword "%"
519 "autocmd BufReadPost *.doc silent %!wvware "%"
520 """""""""""""""""""""""""""""""""""""""""""""""""""""
521 "au BufNewFile,BufRead /home/Administrator/std-java/new1.5/* let g:bnojikes=1
523 autocmd BufWritePre,FileWritePre *.vim ks|call LastMod()|'s
524 autocmd BufWritePre,FileWritePre *.jsp,*.html ks|call LastMod2()|'s
526 autocmd BufNewFile,BufreadPre *.text,*.wiki call TextMode()
527 "autocmd BufNewFile,BufreadPre *.rst call RstMode()
528 autocmd FileType vim setlocal complete=.,k~/dic/vimdiction,w,b,u,i
530 autocmd fileType ahk source $ADDED/bracket.vim
533 """""""""""""""""""""""""""""""""""""""""""""""""""""
535 """""""""""""""""""""""""""""""""""""""""""""""""""""
536 nnoremap <silent> <F8> :Tlist<cr>
537 let Tlist_Show_One_File = 1 " just show tag of current files
538 let Tlist_Exit_OnlyWindow = 1 " if taglist window iis the last one then exit vim
539 let Tlist_File_Fold_Auto_Close=1 " auto fold not editing function list
540 let Tlist_Sort_Type = "name" " order by
541 let Tlist_Use_Right_Window = 1 " split to the right side of the screen
542 let tlist_dosini_settings= 'ini;r:respect'
543 let tlist_html_settings = 'html;a:anchor;f:javascript function;u:url'
544 let tlist_vb_settings= 'vb;t:type;s:sub;f:function'
545 let tlist_ant_settings = 'ant;p:Project;r:Property;t:Target'
546 let JavaBrowser_Use_SingleClick = 0
547 let JavaBrowser_Use_Right_Window = 1
548 let JavaBrowser_Use_Icon = 0
549 let JavaBrowser_Compact_Format = 1
550 let JavaBrowser_Expand_Tree_At_Startup = 1
554 """""""""""""""""""""""""""""""""""""""""""""""""""""
556 """""""""""""""""""""""""""""""""""""""""""""""""""""
557 let g:JavaImpPaths = $JAVALIB."/j2sdk1.5_src,".$JAVALIB."junit_src,".$VIMFILY."/JavaImp/jmplst"
558 let g:JavaImpDataDir = $VIMFILY."/JavaImp"
559 let g:JavaImpDocPaths= $JAVA_DOCPATH
560 let g:JavaImpDocViewer = "viewHtml"
564 """""""""""""""""""""""""""""""""""""""""""""""""""""
566 """""""""""""""""""""""""""""""""""""""""""""""""""""
567 let g:favex_ff='<leader>fa'
568 let g:favex_fd='<leader>fA'
569 """""""""""""""""""""""""""""""""""""""""""""""""""""
571 """""""""""""""""""""""""""""""""""""""""""""""""""""
572 """""""""""""""""""""""""""""""""""""""""""""""""""""
575 au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr>
577 "let g:VCSCommandEdit= 'spilt'
579 """""""""""""""""""""""""""""""""""""""""""""""""""""
581 """""""""""""""""""""""""""""""""""""""""""""""""""""
583 """""""""""""""""""""""""""""""""""""""""""""""""""""
584 "let g:bufExplorerDetailedHelp=1
585 let g:netrw_keepdir=0
586 let g:netrw_cygwin= 1
587 let g:netrw_longlist=1
588 let g:netrw_sort_by="time"
589 let g:netrw_sort_direction="reverse"
590 let g:netrw_timefmt=" %Y %m %d\t%H:%M"
591 let g:netrw_winsize=25
593 """""""""""""""""""""""""""""""""""""""""""""""""""""
595 """""""""""""""""""""""""""""""""""""""""""""""""""""
596 "nmap <silent> <unique> <leader>be <Plug>SelectBuf
597 "nmap <unique> <leader>bl <Plug>SelBufLaunchCmd
598 "let selBufAlwaysShowHidden=0
599 "let selBufIgnoreNonFileBufs=0
602 "nmap <Leader>tv :call TabLineSet_verbose_toggle()<CR>
603 "nmap <Leader>tr :call TabLineSet_verbose_rotate()<CR>
604 "nmap <silent> <Leader>w :call WinWalkerMenu()<CR>
610 "Highlight space at end of line as error
611 "highlight WhitespaceEOL ctermbg=darkred guibg=darkred
612 "match WhitespaceEOL /\s\+$/
618 "set diffexpr=MyDiff()
620 " let opt = '-a --binary '
621 " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
622 " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
623 " let arg1 = v:fname_in
624 " if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
625 " let arg2 = v:fname_new
626 " if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
627 " let arg3 = v:fname_out
628 " if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
629 " silent execute '!e:\prog\Vim\vim63\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
633 function! MyTabLabel(n)
634 let buflist = tabpagebuflist(a:n)
635 let winnr = tabpagewinnr(a:n)
636 return bufname(buflist[winnr - 1])
639 function! MyTabLine()
641 for i in range(tabpagenr('$'))
642 " select the highlighting
643 if i + 1 == tabpagenr()
644 let s .= '%#TabLineSel#'
646 let s .= '%#TabLine#'
649 " set the tab page number (for mouse clicks)
650 let s .= '%' . (i + 1) . 'T'
652 " the label is made by MyTabLabel()
653 let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
656 " after the last tab fill with TabLineFill and reset tab page nr
657 let s .= '%#TabLineFill#%T'
659 " right-align the label to close the current tab page
660 if tabpagenr('$') > 1
661 let s .= '%=%#TabLine#%999Xclose'
667 function! GuiTabLabel()
669 "let bufnrlist = tabpagebuflist(v:lnum)
671 " Add '+' if one of the buffers in the tab page is modified
672 "for bufnr in bufnrlist
673 "if getbufvar(bufnr, "&modified")
679 " Append the number of windows in the tab page if more than one
680 "let wincount = tabpagewinnr(v:lnum, '$')
682 "let label .= wincount
684 if v:lnum == g:currentPage
689 " Append the buffer name
692 function! GuiTabLabel2()
694 let bufnrlist = tabpagebuflist(v:lnum)
696 " Add '+' if one of the buffers in the tab page is modified
697 "for bufnr in bufnrlist
698 "if getbufvar(bufnr, "&modified")
704 " Append the number of windows in the tab page if more than one
705 if v:lnum == g:currentPage
708 let wincount = tabpagewinnr(v:lnum, '$')
710 let label .= wincount
716 function! GuiTabLabelEnter()
717 let g:currentPage=tabpagenr()
718 set guitablabel=%{GuiTabLabel()}%N\ %t\ %{GuiTabLabel2()}
721 function! GuiTabLabelLeave()
724 " the tab setting and mapping
726 "set guitablabel=%N\ %f
727 "set guitablabel=%{GuiTabLabel()}
729 "set guitablabel=%N/\ %t\ %M
730 set tabline=%!MyTabLine()
732 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>
733 map <silent><C-tab> :if g:toggleTabs == 1<CR>:tabnext<CR>:else<CR>:bn<CR>:endif<CR>
734 map <silent><C-S-tab> :if g:toggleTabs == 1<CR>:tabprevious<CR>:else<CR>:bp<CR>:endif<CR>
736 map <leader>tt <esc>:tabnew<cr>:let g:toggleTabs=1<cr>
737 map <leader>tx :tabclose<cr>:if tabpagenr("$") == 1<cr>let g:toggleTabs=0<cr>:endif<cr><cr>
738 map <leader>tm :tabmove
739 map <leader>tn :tabnext <cr>
740 map <leader>tp :tabprevious <cr>
741 "map <C-Tab> :tabn <CR>
742 "map <C-S-Tab> :tabp <CR>
745 autocmd TabEnter * call GuiTabLabelEnter()
749 if has("gui_running")
750 function! InfoGuiTooltip()
752 let wincount = tabpagewinnr(tabpagenr(),'$')
754 "get name of active buffers in windows
755 for i in tabpagebuflist()
756 let bufferlist .= '['.fnamemodify(bufname(i),':t')."]"
758 return bufname($).'-'.bufferlist
760 set guitabtooltip=%!InfoGuiTooltip()
763 function! FoldSpellBalloon()
764 let foldStart = foldclosed(v:beval_lnum )
765 let foldEnd = foldclosedend(v:beval_lnum)
767 " Detect if we are in a fold
769 " Detect if we are on a misspelled word
770 let lines = spellsuggest( spellbadword(v:beval_text)[ 0 ], 5, 0 )
773 let numLines = foldEnd - foldStart + 1
774 " if we have too many lines in fold, show only the first 14
775 " and the last 14 lines
777 let lines = getline( foldStart, foldStart + 14 )
778 let lines += [ '-- Snipped ' . ( numLines - 30 ) . ' lines --' ]
779 let lines += getline( foldEnd - 14, foldEnd )
781 "less than 30 lines, lets show all of them
782 let lines = getline( foldStart, foldEnd )
786 return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
788 set balloonexpr=FoldSpellBalloon()
795 let g:vimim_chinese_punctuation=0
798 let jslint_highlight_color = 'yellow'
803 set csprg=/usr/bin/mlcscope
805 set csprg=%CYGWIN_HOME%\bin\\mlcscope.exe
808 " for clipbord conflict with NERD
809 nmap <unique> <silent> <Leader>co <Plug>ClipBrdOpen
811 " add my highlight setting
812 call MyColorSetting()