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
231 inoremap <C-u> <esc>g-a
232 inoremap <C-r> <esc>g+a
233 "inoremap <C-u> <C-O>u
234 "inoremap <C-r> <C-O><C-R>
238 " my complete setting
239 " failure try, must find a way to map /
240 "inoremap / <kDivide>
241 "imap <expr> <F3> "\u611B"
242 "inoremap <Right> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>
244 "like in emacs to kill a line
245 inoremap <C-k> <space><esc>d$a
247 "for del the auto comment
248 inoremap <m-cr> <cr><esc>^d$a
250 " reproduce previous line word by word
251 "inoremap <C-j> @@@<ESC>hhkyWjl?@@@<CR>P/@@@<CR>3s
254 " Put string marked by visual mode as default for search commands / and ?
255 " Warning: extending the marked text by searching doesn't work any more.
256 vnoremap / y/<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
257 vnoremap ? y?<C-R>=escape(substitute(@","\n.*",'',''),'/\?*.$^~][')<cr>
259 " substitute(@",..) - remove lines after first, if >1 line highlighted
260 " escape(..) - put '\' before all characters meaningful in regexp's
261 " y - yank current selection (in register ")
262 " ctrl-r = .. <cr> - put expression after / as earch string
263 " credits go to Stefan Roemer and Peppe (Preben Guldberg).
265 " Remove whitespace from lines containing nothing else (grr to all nedit users)
267 "for the mouse conflict key(c-insert) of HP notebook
268 noremap <Insert> <Esc>
269 noremap <C-Insert> <Esc>
270 inoremap <Insert> <Down>
271 inoremap <C-Insert> <Down>
275 "for new tab page setting
276 map <leader>ta <esc>:tab sball<cr>
279 map <leader>bp <esc>:bp<return>
280 map <leader>bn <esc>:bn<return>
281 map <leader>bl <esc>:ls!<cr>
283 nnoremap <leader>dd <esc>:call MyTriggerMore()<cr>
284 map <leader>yy <esc>^"*y$
286 "editor setting mapping
287 map <leader>ec <esc>:call MyCoding()<cr>
288 map <leader>el <esc>:set list!<cr>
289 map <leader>em <esc>:call MyMenu()<cr>
290 map <leader>en <esc>:set nu!<cr>:set cursorline!<cr>
291 map <leader>ew <esc>:call MyWrap()<cr>
293 "file or browser mapping
294 map <leader>fx <esc>:Ex<cr>
295 nnoremap <leader>fd :set fileformat=dos<cr>
296 nnoremap <leader>fu :set fileformat=unix<cr>
297 map <leader>ww <esc>:call MyUrl(expand('<cWORD>'))<cr>
298 map <leader>m <esc>:silent MarksBrowser<cr>
301 map <leader>sh <esc>:set hlsearch!<cr>
302 map <leader>sn <esc>:%s//&/gn<cr>
305 map <leader>ss <esc>:setlocal spell!<cr>
307 "ca xsp write !aspell -a --lang="en_US"<cr>
308 "map <leader>s <Esc>:w<cr><Esc>:!aspell -c --dont-backup --lang=en_US "%:p"<cr>:e! "%"<cr><cr>
310 "map <leader>df <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Dictionary?book=Dictionary&va=<cword>"<cr><cr>
311 "map <leader>dF <esc>:silent !start firefox "http://www.m-w.com/cgi-bin/Thesaurus?book=Thesaurus&va=<cword>"<cr><cr>
312 "map <leader>dW <esc>:silent !wnb <cword> <cr><cr>
314 "for new tab setting and new align setting
315 " leader mode mapping
316 map <leader>la <esc>:call SecondLoadAlign()<cr>
317 map <leader>lt <esc>:call SecondTriggerChangeTab()<cr>
319 " remove space and enter charactor
320 map <leader>rs <esc>::%s= *$==<cr>
321 map <leader>rd <esc>:%s/\r//g<cr>
324 "MAKE IT EASY TO UPDATE/RELOAD_vimrc
325 nnoremap <leader>-s <esc>:source ~/_vimrc<cr>
326 nnoremap <leader>-v <esc>:e ~/_vimrc<cr>
328 " trigger color style
330 "if has("gui_running") "for gdk+ vim seting
331 map <leader>cd <esc>:call MyTriggerColor()<cr>
335 """""""""""""""""""""""""""""""""""""""""""""""""""""
336 " <F5>-<F8>maping for savers-pluging
337 " <F5> decrease version viewed in VersDiff window
338 " <F6> increase version viewed in VersDiff window
339 " <F7> do VersDiff with cvs version of current file
340 " <F8> cancel VersDiff window
341 nmap <silent> <F3> :VersDiff -<cr>
342 nmap <silent> <F4> :VersDiff +<cr>
343 """""""""""""""""""""""""""""""""""""""""""""""""""""
345 " for autohotkey to using:)
346 " 0=english input 1=chinese input
351 com! MM call MyMore()
352 """""""""""""""""""""""""""""""""""""""""""""""""""""
354 """""""""""""""""""""""""""""""""""""""""""""""""""""
355 "Programmings abbrevs
356 """""""""""""""""""""""""""""""""""""""""""""""""""""
357 """""""""""""""""""""""""""""""""""""""""""""""""""""
358 "Informational abbrevs
359 """""""""""""""""""""""""""""""""""""""""""""""""""""
360 "iab xda <c-r>=strftime("%Y-%m-%d-%H:%M:%S")<cr>
361 iab xda <c-r>=substitute(system("date +%Y-%m-%d-%H:%M"),"\n","","")<cr>
365 iabbrev synchronisation
375 """""""""""""""""""""""""""""""""""""""""""""""""""""
378 """""""""""""""""""""""""""""""""""""""""""""""""""""
379 "for no swap attation
383 if v:statusmsg =~ '\.sw[^p]$'
384 set statusline=%2*%=\ \ \ %50(%f\ @%n%*%1*[$]%*%2*[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
387 set statusline=%2*%=\ \ \ %50(%f\ @%n[%{FunFileEncoding()}]%r%m%y#%{changenr()}%=\ \ \ %-14.(%l,%c\(%v\)%)\ %p%%%)%*
388 "set statusline=%2*%=\ \ \ %50(%f\ @%n[%{&ff}]%r%m%y%=\ \ \ %-14.(%l,%c%V%)\ %p%%%)%*
394 autocmd BufEnter * silent call CheckSwap()
396 """""""""""""""""""""""""""""""""""""""""""""""""""""
401 """""""""""""""""""""""""""""""""""""""""""""""""""""
403 """""""""""""""""""""""""""""""""""""""""""""""""""""
404 "let g:vikiUseParentSuffix = 1
405 "let g:vikiSpecialFiles='jpg\|gif\|bmp\|pdf\|dvi\|ps\|eps\|png\|jpeg\|wmf\|otl'
406 "let g:vikiOpenFileWith_otl = 'silent !D:/prog/Natara/Bonsai/Bonsai.exe %{FILE}'
408 " we want to allow deplate to execute ruby code and external helper
410 "let g:deplatePrg = "deplate -x -X "
411 "au FileType viki compiler deplate
412 "let g:vikiInterOLM= $HOME ."/olm"
413 "let g:vikiInterOLM_suffix= ".olm"
414 "let g:vikiInterHW= $HOME ."/viki"
415 "let g:vikiInterHW_suffix= ".txt"
420 """""""""""""""""""""""""""""""""""""""""""""""""""""
422 map <leader>rr :MRU<cr>gg
423 let MRU_Max_Entries = 500
424 let MRU_Exclude_Files = '^/tmp/.*\|^/var/tmp/.*|^c:\\temp\\.*'
425 let MRU_File = $VIMFILY . "/_vim_mru_files"
426 "let MRU_Auto_Close = 0 " to keep the mru window
427 """""""""""""""""""""""""""""""""""""""""""""""""""""
429 """""""""""""""""""""""""""""""""""""""""""""""""""""
430 " setting for subversion
431 nmap <leader>va <Plug>VCSAdd
432 nmap <leader>vn <Plug>VCSAnnotate
433 nmap <leader>vc <Plug>VCSCommit
434 nmap <leader>vd <Plug>VCSDiff
435 nmap <leader>ve <Plug>VCSEdit
436 nmap <leader>vi <Plug>VCSEditors
437 nmap <leader>vg <Plug>VCSGotoOriginal
438 nmap <leader>vG <Plug>VCSGotoOriginal!
439 nmap <leader>vl <Plug>VCSLog
440 nmap <leader>vr <Plug>VCSReview
441 nmap <leader>vs <Plug>VCSStatus
442 nmap <leader>vt <Plug>VCSUnedit
443 nmap <leader>vu <Plug>VCSUpdate
444 nmap <leader>vv <Plug>VCSVimDiff
445 nmap <leader>vwv <Plug>VCSWatchers
446 nmap <leader>vwa <Plug>VCSWatchAdd
447 nmap <leader>vwn <Plug>VCSWatchOn
448 nmap <leader>vwf <Plug>VCSWatchOff
449 nmap <leader>vwf <Plug>VCSWatchRemove
450 """""""""""""""""""""""""""""""""""""""""""""""""""""
453 """""""""""""""""""""""""""""""""""""""""""""""""""""
455 """""""""""""""""""""""""""""""""""""""""""""""""""""
456 "autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
457 "autocmd BufEnter * :lcd %:p:h " switch to current dir
458 "autocmd GUIEnter * :simalt ~x " maximize the screen
460 augroup filetypedetect
461 """""""""""""""""""""""""""""""""""""""""""""""""""""
462 "for help and readbale file mode
463 augroup! filetypedetect
464 autocmd FileType help call MyMore()
465 """""""""""""""""""""""""""""""""""""""""""""""""""""
467 """""""""""""""""""""""""""""""""""""""""""""""""""""
468 "for the make error windows quickfix windows
469 au BufReadPost quickfix set modifiable
470 au BufReadPost quickfix silent g/^/s//\=line(".")." "/
471 autocmd FileType qf call MyMore()
472 """""""""""""""""""""""""""""""""""""""""""""""""""""
474 """""""""""""""""""""""""""""""""""""""""""""""""""""
476 """""""""""""""""""""""""""""""""""""""""""""""""""""
477 "autocmd BufNewFile *.sh 0r ~/vimtemplate/skeleton.sh
478 "autocmd BufNewFile *.vim 0r $HOME/vimfiles/skel/vim.skel
479 autocmd BufNewFile,BufReadPre *.java,*.vim,*.sh,*.html,*.xhtml,*.py source $ADDED/skel.vim
480 "autocmd BufNewFile *.java 0r $VIMFILY/skel/java.skel
481 "autocmd BufNewFile *.vim 0r $VIMFILY/skel/vim.skel
482 "autocmd BufNewFile *.sh 0r $VIMFILY/skel/sh.skel
483 "autocmd BufNewFile *.html 0r $VIMFILY/skel/html.skel
484 "autocmd BufNewFile *.xhtml 0r $VIMFILY/skel/xhtml.skel
485 "autocmd BufNewFile *.java,*.vim,*.sh,*.html,*.xhtml call Replacy()
486 """""""""""""""""""""""""""""""""""""""""""""""""""""
487 """""""""""""""""""""""""""""""""""""""""""""""""""""
489 "au BufReadPre *.doc set ro
490 "au BufReadPre *.doc set hlsearch!
491 "au BufReadPost *.doc silent %!antiword "%"
492 "autocmd BufReadPost *.doc silent %!wvware "%"
493 """""""""""""""""""""""""""""""""""""""""""""""""""""
494 "au BufNewFile,BufRead /home/Administrator/std-java/new1.5/* let g:bnojikes=1
496 autocmd BufWritePre,FileWritePre *.vim ks|call LastMod()|'s
497 autocmd BufWritePre,FileWritePre *.jsp,*.html ks|call LastMod2()|'s
499 autocmd BufNewFile,BufreadPre *.text,*.wiki call TextMode()
500 "autocmd BufNewFile,BufreadPre *.rst call RstMode()
501 autocmd FileType vim setlocal complete=.,k~/dic/vimdiction,w,b,u,i
503 autocmd fileType ahk source $ADDED/bracket.vim
506 """""""""""""""""""""""""""""""""""""""""""""""""""""
508 """""""""""""""""""""""""""""""""""""""""""""""""""""
509 nnoremap <silent> <F8> :Tlist<cr>
510 let Tlist_Show_One_File = 1 " just show tag of current files
511 let Tlist_Exit_OnlyWindow = 1 " if taglist window iis the last one then exit vim
512 let Tlist_File_Fold_Auto_Close=1 " auto fold not editing function list
513 let Tlist_Sort_Type = "name" " order by
514 let Tlist_Use_Right_Window = 1 " split to the right side of the screen
515 let tlist_dosini_settings= 'ini;r:respect'
516 let tlist_html_settings = 'html;a:anchor;f:javascript function;u:url'
517 let tlist_vb_settings= 'vb;t:type;s:sub;f:function'
518 let tlist_ant_settings = 'ant;p:Project;r:Property;t:Target'
519 let JavaBrowser_Use_SingleClick = 0
520 let JavaBrowser_Use_Right_Window = 1
521 let JavaBrowser_Use_Icon = 0
522 let JavaBrowser_Compact_Format = 1
523 let JavaBrowser_Expand_Tree_At_Startup = 1
527 """""""""""""""""""""""""""""""""""""""""""""""""""""
529 """""""""""""""""""""""""""""""""""""""""""""""""""""
530 let g:JavaImpPaths = $JAVALIB."/j2sdk1.5_src,".$JAVALIB."junit_src,".$VIMFILY."/JavaImp/jmplst"
531 let g:JavaImpDataDir = $VIMFILY."/JavaImp"
532 let g:JavaImpDocPaths= $JAVA_DOCPATH
533 let g:JavaImpDocViewer = "viewHtml"
537 """""""""""""""""""""""""""""""""""""""""""""""""""""
539 """""""""""""""""""""""""""""""""""""""""""""""""""""
540 let g:favex_ff='<leader>fa'
541 let g:favex_fd='<leader>fA'
542 """""""""""""""""""""""""""""""""""""""""""""""""""""
544 """""""""""""""""""""""""""""""""""""""""""""""""""""
545 """""""""""""""""""""""""""""""""""""""""""""""""""""
548 au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr>
550 "let g:VCSCommandEdit= 'spilt'
552 """""""""""""""""""""""""""""""""""""""""""""""""""""
554 """""""""""""""""""""""""""""""""""""""""""""""""""""
556 """""""""""""""""""""""""""""""""""""""""""""""""""""
557 "let g:bufExplorerDetailedHelp=1
558 let g:netrw_keepdir=0
559 let g:netrw_cygwin= 1
560 let g:netrw_longlist=1
561 let g:netrw_sort_by="time"
562 let g:netrw_sort_direction="reverse"
563 let g:netrw_timefmt=" %Y %m %d\t%H:%M"
564 let g:netrw_winsize=25
566 """""""""""""""""""""""""""""""""""""""""""""""""""""
568 """""""""""""""""""""""""""""""""""""""""""""""""""""
569 "nmap <silent> <unique> <leader>be <Plug>SelectBuf
570 "nmap <unique> <leader>bl <Plug>SelBufLaunchCmd
571 "let selBufAlwaysShowHidden=0
572 "let selBufIgnoreNonFileBufs=0
575 "nmap <Leader>tv :call TabLineSet_verbose_toggle()<CR>
576 "nmap <Leader>tr :call TabLineSet_verbose_rotate()<CR>
577 "nmap <silent> <Leader>w :call WinWalkerMenu()<CR>
583 "Highlight space at end of line as error
584 "highlight WhitespaceEOL ctermbg=darkred guibg=darkred
585 "match WhitespaceEOL /\s\+$/
591 "set diffexpr=MyDiff()
593 " let opt = '-a --binary '
594 " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
595 " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
596 " let arg1 = v:fname_in
597 " if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
598 " let arg2 = v:fname_new
599 " if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
600 " let arg3 = v:fname_out
601 " if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
602 " silent execute '!e:\prog\Vim\vim63\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
606 function! MyTabLabel(n)
607 let buflist = tabpagebuflist(a:n)
608 let winnr = tabpagewinnr(a:n)
609 return bufname(buflist[winnr - 1])
612 function! MyTabLine()
614 for i in range(tabpagenr('$'))
615 " select the highlighting
616 if i + 1 == tabpagenr()
617 let s .= '%#TabLineSel#'
619 let s .= '%#TabLine#'
622 " set the tab page number (for mouse clicks)
623 let s .= '%' . (i + 1) . 'T'
625 " the label is made by MyTabLabel()
626 let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
629 " after the last tab fill with TabLineFill and reset tab page nr
630 let s .= '%#TabLineFill#%T'
632 " right-align the label to close the current tab page
633 if tabpagenr('$') > 1
634 let s .= '%=%#TabLine#%999Xclose'
640 function! GuiTabLabel()
642 "let bufnrlist = tabpagebuflist(v:lnum)
644 " Add '+' if one of the buffers in the tab page is modified
645 "for bufnr in bufnrlist
646 "if getbufvar(bufnr, "&modified")
652 " Append the number of windows in the tab page if more than one
653 "let wincount = tabpagewinnr(v:lnum, '$')
655 "let label .= wincount
657 if v:lnum == g:currentPage
662 " Append the buffer name
665 function! GuiTabLabel2()
667 let bufnrlist = tabpagebuflist(v:lnum)
669 " Add '+' if one of the buffers in the tab page is modified
670 "for bufnr in bufnrlist
671 "if getbufvar(bufnr, "&modified")
677 " Append the number of windows in the tab page if more than one
678 if v:lnum == g:currentPage
681 let wincount = tabpagewinnr(v:lnum, '$')
683 let label .= wincount
689 function! GuiTabLabelEnter()
690 let g:currentPage=tabpagenr()
691 set guitablabel=%{GuiTabLabel()}%N\ %t\ %{GuiTabLabel2()}
694 function! GuiTabLabelLeave()
697 " the tab setting and mapping
699 "set guitablabel=%N\ %f
700 "set guitablabel=%{GuiTabLabel()}
702 "set guitablabel=%N/\ %t\ %M
703 set tabline=%!MyTabLine()
705 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>
706 map <silent><C-tab> :if g:toggleTabs == 1<CR>:tabnext<CR>:else<CR>:bn<CR>:endif<CR>
707 map <silent><C-S-tab> :if g:toggleTabs == 1<CR>:tabprevious<CR>:else<CR>:bp<CR>:endif<CR>
709 map <leader>tt <esc>:tabnew<cr>:let g:toggleTabs=1<cr>
710 map <leader>tx :tabclose<cr>:if tabpagenr("$") == 1<cr>let g:toggleTabs=0<cr>:endif<cr><cr>
711 map <leader>tm :tabmove
712 map <leader>tn :tabnext <cr>
713 map <leader>tp :tabprevious <cr>
714 "map <C-Tab> :tabn <CR>
715 "map <C-S-Tab> :tabp <CR>
718 autocmd TabEnter * call GuiTabLabelEnter()
722 if has("gui_running")
723 function! InfoGuiTooltip()
725 let wincount = tabpagewinnr(tabpagenr(),'$')
727 "get name of active buffers in windows
728 for i in tabpagebuflist()
729 let bufferlist .= '['.fnamemodify(bufname(i),':t')."]"
731 return bufname($).'-'.bufferlist
733 set guitabtooltip=%!InfoGuiTooltip()
736 function! FoldSpellBalloon()
737 let foldStart = foldclosed(v:beval_lnum )
738 let foldEnd = foldclosedend(v:beval_lnum)
740 " Detect if we are in a fold
742 " Detect if we are on a misspelled word
743 let lines = spellsuggest( spellbadword(v:beval_text)[ 0 ], 5, 0 )
746 let numLines = foldEnd - foldStart + 1
747 " if we have too many lines in fold, show only the first 14
748 " and the last 14 lines
750 let lines = getline( foldStart, foldStart + 14 )
751 let lines += [ '-- Snipped ' . ( numLines - 30 ) . ' lines --' ]
752 let lines += getline( foldEnd - 14, foldEnd )
754 "less than 30 lines, lets show all of them
755 let lines = getline( foldStart, foldEnd )
759 return join( lines, has( "balloon_multiline" ) ? "\n" : " " )
761 set balloonexpr=FoldSpellBalloon()
768 let g:vimim_chinese_punctuation=0
771 let jslint_highlight_color = 'yellow'
776 set csprg=/usr/bin/mlcscope
778 set csprg=%CYGWIN_HOME%\bin\\mlcscope.exe
781 " for clipbord conflict with NERD
782 nmap <unique> <silent> <Leader>co <Plug>ClipBrdOpen
784 " add my highlight setting
785 call MyColorSetting()