灏嗕竴涓嬩唬鐮乧opy鍒� 鐢ㄦ埛鐩綍涓� 鏂板缓鏂囦欢涓郝� .vimrc
淇濆瓨鍗冲彲鐢熸晥锛� 濡傛灉鎯虫墍鏈夌敤鎴风敓鏁� 璇蜂慨鏀� /etc/vimrc (寤鸿鍏坈p涓�浠�)
"=========================================================================
" DesCRiption: 閫傚悎鑷繁浣跨敤鐨剉imrc鏂囦欢锛宖or Linux/Windows, GUI/Console
"
" Last Change: 2010骞�08鏈�02鏃� 15鏃�13鍒�
"
" Version: 1.80
"
"=========================================================================
set nocompatible " 鍏抽棴 vi 鍏煎妯″紡
syntax on " 鑷姩璇硶楂樹寒
colorscheme molokai " 璁惧畾閰嶈壊鏂规
set number " 鏄剧ず琛屽彿
set cursorline " 绐佸嚭鏄剧ず褰撳墠琛�
set ruler " 鎵撳紑鐘舵�佹爮鏍囧昂
set shiftwidth=4 " 璁惧畾 << 鍜� >> 鍛戒护绉诲姩鏃剁殑瀹藉害涓� 4
set softtabstop=4 " 浣垮緱鎸夐��鏍奸敭鏃跺彲浠ヤ竴娆″垹鎺� 4 涓┖鏍�
set tabstop=4 " 璁惧畾 tab 闀垮害涓� 4
set nobackup " 瑕嗙洊鏂囦欢鏃朵笉澶囦唤
set autochdir " 鑷姩鍒囨崲褰撳墠鐩綍涓哄綋鍓嶆枃浠舵墍鍦ㄧ殑鐩綍
filetype plugin indent on " 寮�鍚彃浠�
set backupcopy=yes " 璁剧疆澶囦唤鏃剁殑琛屼负涓鸿鐩�
set ignorecase smartcase " 鎼滅储鏃跺拷鐣ュぇ灏忓啓锛屼絾鍦ㄦ湁涓�涓垨浠ヤ笂澶у啓瀛楁瘝鏃朵粛淇濇寔瀵瑰ぇ灏忓啓鏁忔劅
set nowrapscan " 绂佹鍦ㄦ悳绱㈠埌鏂囦欢涓ょ鏃堕噸鏂版悳绱�
set incsearch " 杈撳叆鎼滅储鍐呭鏃跺氨鏄剧ず鎼滅储缁撴灉
set hlsearch " 鎼滅储鏃堕珮浜樉绀鸿鎵惧埌鐨勬枃鏈�
set noerrorbells " 鍏抽棴閿欒淇℃伅鍝嶉搩
set novisualbell " 鍏抽棴浣跨敤鍙鍝嶉搩浠f浛鍛煎彨
set t_vb= " 缃┖閿欒閾冨0鐨勭粓绔唬鐮�
" set showmatch " 鎻掑叆鎷彿鏃讹紝鐭殏鍦拌烦杞埌鍖归厤鐨勫搴旀嫭鍙�
" set matchtime=2 " 鐭殏璺宠浆鍒板尮閰嶆嫭鍙风殑鏃堕棿
set magic " 璁剧疆榄旀湳
set hidden " 鍏佽鍦ㄦ湁鏈繚瀛樼殑淇敼鏃跺垏鎹㈢紦鍐插尯锛屾鏃剁殑淇敼鐢� vim 璐熻矗淇濆瓨
set guioptions-=T " 闅愯棌宸ュ叿鏍�
set guioptions-=m " 闅愯棌鑿滃崟鏍�
set smartindent " 寮�鍚柊琛屾椂浣跨敤鏅鸿兘鑷姩缂╄繘
set backspace=indent,eol,start
" 涓嶈瀹氬湪鎻掑叆鐘舵�佹棤娉曠敤閫�鏍奸敭鍜� Delete 閿垹闄ゅ洖杞︾
set cmdheight=1 " 璁惧畾鍛戒护琛岀殑琛屾暟涓� 1
set laststatus=2 " 鏄剧ず鐘舵�佹爮 (榛樿鍊间负 1, 鏃犳硶鏄剧ず鐘舵�佹爮)
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
" 璁剧疆鍦ㄧ姸鎬佽鏄剧ず鐨勪俊鎭�
set foldenable " 寮�濮嬫姌鍙�
set foldmethod=syntax " 璁剧疆璇硶鎶樺彔
set foldcolumn=0 " 璁剧疆鎶樺彔鍖哄煙鐨勫搴�
setlocal foldlevel=1 " 璁剧疆鎶樺彔灞傛暟涓�
" set foldclose=all " 璁剧疆涓鸿嚜鍔ㄥ叧闂姌鍙�
" nnoremap @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')
" 鐢ㄧ┖鏍奸敭鏉ュ紑鍏虫姌鍙�
" return OS type, eg: windows, or linux, mac, et.st..
function! MySys()
if has("win16") || has("win32") || has("win64") || has("win95")
return "windows"
elseif has("unix")
return "linux"
endif
endfunction
" 鐢ㄦ埛鐩綍鍙橀噺$VIMFILES
if MySys() == "windows"
let $VIMFILES = $VIM.'/vimfiles'
elseif MySys() == "linux"
let $VIMFILES = $HOME.'/.vim'
endif
" 璁惧畾doc鏂囨。鐩綍
let helptags=$VIMFILES.'/doc'
" 璁剧疆瀛椾綋 浠ュ強涓枃鏀寔
if has("win32")
set guifont=Inconsolata:h12:cANSI
endif
" 閰嶇疆澶氳瑷�鐜
if has("multi_byte")
" UTF-8 缂栫爜
set encoding=utf-8
set termencoding=utf-8
set formatoptions+=mM
set fencs=utf-8,gbk
if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
set ambiwidth=double
endif
if has("win32")
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
endif
" Buffers鎿嶄綔蹇嵎鏂瑰紡!
nnoremap :bnext
nnoremap :bprevious
" Tab鎿嶄綔蹇嵎鏂瑰紡!
nnoremap :tabnext
nnoremap :tabprev
"鍏充簬tab鐨勫揩鎹烽敭
" map tn :tabnext
" map tp :tabprevious
" map td :tabnew .
" map te :tabedit
" map tc :tabclose
"绐楀彛鍒嗗壊鏃�,杩涜鍒囨崲鐨勬寜閿儹閿渶瑕佽繛鎺ヤ袱娆�,姣斿浠庝笅鏂圭獥鍙gЩ鍔�
"鍏夋爣鍒颁笂鏂圭獥鍙�,闇�瑕乲,闈炲父楹荤儲,鐜板湪閲嶆槧灏勪负,鍒囨崲鐨�
"鏃跺�欎細鍙樺緱闈炲父鏂逛究.
nnoremap h
nnoremap j
nnoremap k
nnoremap l
"涓�浜涗笉閿欑殑鏄犲皠杞崲璇硶锛堝鏋滃湪涓�涓枃浠朵腑娣峰悎浜嗕笉鍚岃瑷�鏃舵湁鐢級
nnoremap 1 :set filetype=xhtml
nnoremap 2 :set filetype=css
nnoremap 3 :set filetype=javascript
nnoremap 4 :set filetype=php
" set fileformats=unix,dos,mac
" nmap fd :se fileformat=dos
" nmap fu :se fileformat=unix
" use Ctrl+[l|n|p|cc] to list|next|previous|jump to count the result
" map l :cl
" map n :cn
" map p :cp
" map c :cc
" 璁� Tohtml 浜х敓鏈� CSS 璇硶鐨� html
" syntax/2html.vim锛屽彲浠ョ敤:runtime! syntax/2html.vim
let html_use_css=1
" Python 鏂囦欢鐨勪竴鑸缃紝姣斿涓嶈 tab 绛�
autocmd FileType python set tabstop=4 shiftwidth=4 expandtab
autocmd FileType python map :!python %
" 閫変腑鐘舵�佷笅 Ctrl+c 澶嶅埗
vmap "+y
" 鎵撳紑javascript鎶樺彔
let b:javascript_fold=1
" 鎵撳紑javascript瀵筪om銆乭tml鍜宑ss鐨勬敮鎸�
let javascript_enable_domhtmlcss=1
" 璁剧疆瀛楀吀 ~/.vim/dict/鏂囦欢鐨勮矾寰�
autocmd filetype javascript set dictionary=$VIMFILES/dict/javascript.dict
autocmd filetype css set dictionary=$VIMFILES/dict/css.dict
autocmd filetype php set dictionary=$VIMFILES/dict/php.dict
"-----------------------------------------------------------------
" plugin - bufexplorer.vim Buffers鍒囨崲
" \be 鍏ㄥ睆鏂瑰紡鏌ョ湅鍏ㄩ儴鎵撳紑鐨勬枃浠跺垪琛�
" \bv 宸﹀彸鏂瑰紡鏌ョ湅 \bs 涓婁笅鏂瑰紡鏌ョ湅
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - taglist.vim 鏌ョ湅鍑芥暟鍒楄〃锛岄渶瑕乧tags绋嬪簭
" F4 鎵撳紑闅愯棌taglist绐楀彛
"-----------------------------------------------------------------
if MySys() == "windows" " 璁惧畾windows绯荤粺涓璫tags绋嬪簭鐨勪綅缃�
let Tlist_Ctags_Cmd = '"'.$VIMRUNTIME.'/ctags.exe"'
elseif MySys() == "linux" " 璁惧畾windows绯荤粺涓璫tags绋嬪簭鐨勪綅缃�
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
endif
nnoremap :TlistToggle
let Tlist_Show_One_File = 1 " 涓嶅悓鏃舵樉绀哄涓枃浠剁殑tag锛屽彧鏄剧ず褰撳墠鏂囦欢鐨�
let Tlist_Exit_OnlyWindow = 1 " 濡傛灉taglist绐楀彛鏄渶鍚庝竴涓獥鍙o紝鍒欓��鍑簐im
let Tlist_Use_Right_Window = 1 " 鍦ㄥ彸渚х獥鍙d腑鏄剧ずtaglist绐楀彛
let Tlist_File_Fold_Auto_Close=1 " 鑷姩鎶樺彔褰撳墠闈炵紪杈戞枃浠剁殑鏂规硶鍒楄〃
let Tlist_Auto_Open = 0
let Tlist_Auto_Update = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Compact_Format = 1
"-----------------------------------------------------------------
" plugin - mark.vim 缁欏悇绉峵ags鏍囪涓嶅悓鐨勯鑹诧紝渚夸簬瑙傜湅璋冨紡鐨勬彃浠躲��
" \m mark or unmark the word under (or before) the cursor
" \r manually input a regular expression. 鐢ㄤ簬鎼滅储.
" \n clear this mark (i.e. the mark under the cursor), or clear all highlighted marks .
" \* 褰撳墠MarkWord鐨勪笅涓�涓� \# 褰撳墠MarkWord鐨勪笂涓�涓�
" \/ 鎵�鏈塎arkWords鐨勪笅涓�涓� \? 鎵�鏈塎arkWords鐨勪笂涓�涓�
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - NERD_tree.vim 浠ユ爲鐘舵柟寮忔祻瑙堢郴缁熶腑鐨勬枃浠跺拰鐩綍
" :ERDtree 鎵撳紑NERD_tree :NERDtreeClose 鍏抽棴NERD_tree
" o 鎵撳紑鍏抽棴鏂囦欢鎴栬�呯洰褰� t 鍦ㄦ爣绛鹃〉涓墦寮�
" T 鍦ㄥ悗鍙版爣绛鹃〉涓墦寮� ! 鎵ц姝ゆ枃浠�
" p 鍒颁笂灞傜洰褰� P 鍒版牴鐩綍
" K 鍒扮涓�涓妭鐐� J 鍒版渶鍚庝竴涓妭鐐�
" u 鎵撳紑涓婂眰鐩綍 m 鏄剧ず鏂囦欢绯荤粺鑿滃崟锛堟坊鍔犮�佸垹闄ゃ�佺Щ鍔ㄦ搷浣滐級
" r 閫掑綊鍒锋柊褰撳墠鐩綍 R 閫掑綊鍒锋柊褰撳墠鏍圭洰褰�
"-----------------------------------------------------------------
" F3 NERDTree 鍒囨崲
map :NERDTreeToggle
imap :NERDTreeToggle
"-----------------------------------------------------------------
" plugin - NERD_commenter.vim 娉ㄩ噴浠g爜鐢ㄧ殑锛�
" [count],cc 鍏夋爣浠ヤ笅count琛岄�愯娣诲姞娉ㄩ噴(7,cc)
" [count],cu 鍏夋爣浠ヤ笅count琛岄�愯鍙栨秷娉ㄩ噴(7,cu)
" [count],cm 鍏夋爣浠ヤ笅count琛屽皾璇曟坊鍔犲潡娉ㄩ噴(7,cm)
" ,cA 鍦ㄨ灏炬彃鍏� /* */,骞朵笖杩涘叆鎻掑叆妯″紡銆� 杩欎釜鍛戒护鏂逛究鍐欐敞閲娿��
" 娉細count鍙傛暟鍙�夛紝鏃犲垯榛樿涓洪�変腑琛屾垨褰撳墠琛�
"-----------------------------------------------------------------
let NERDSpaceDelims=1 " 璁╂敞閲婄涓庤鍙ヤ箣闂寸暀涓�涓┖鏍�
let NERDCompactSexyComs=1 " 澶氳娉ㄩ噴鏃舵牱瀛愭洿濂界湅
"-----------------------------------------------------------------
" plugin - DoxygenToolkit.vim 鐢辨敞閲婄敓鎴愭枃妗o紝骞朵笖鑳藉蹇�熺敓鎴愬嚱鏁版爣鍑嗘敞閲�
"-----------------------------------------------------------------
let g:DoxygenToolkit_authorName="Asins - asinsimple AT gmail DOT com"
let g:DoxygenToolkit_briefTag_funcName="yes"
map da :DoxAuthor
map df :Dox
map db :DoxBlock
map dc a /* */
"-----------------------------------------------------------------
" plugin 鈥� ZenCoding.vim 寰堥叿鐨勬彃浠讹紝HTML浠g爜鐢熸垚
" 鎻掍欢鏈�鏂扮増锛歨ttp://github.com/mattn/zencoding-vim
" 甯哥敤鍛戒护鍙湅锛歨ttp://nootn.com/blog/Tool/23/
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin 鈥� checksyntax.vim JavaScript甯歌璇硶閿欒妫�鏌�
" 榛樿蹇嵎鏂瑰紡涓� F5
"-----------------------------------------------------------------
let g:checksyntax_auto = 0 " 涓嶈嚜鍔ㄦ鏌�
"-----------------------------------------------------------------
" plugin - NeoComplCache.vim 鑷姩琛ュ叏鎻掍欢
"-----------------------------------------------------------------
let g:AutoComplPop_NotEnableAtStartup = 1
let g:NeoComplCache_EnableAtStartup = 1
let g:NeoComplCache_SmartCase = 1
let g:NeoComplCache_TagsAutoUpdate = 1
let g:NeoComplCache_EnableInfo = 1
let g:NeoComplCache_EnableCamelCaseCompletion = 1
let g:NeoComplCache_MinSyntaxLength = 3
let g:NeoComplCache_EnableSkipCompletion = 1
let g:NeoComplCache_SkipInputTime = '0.5'
let g:NeoComplCache_SnippetsDir = $VIMFILES.'/snippets'
" completion.
inoremap pumvisible() ? "\" : "\"
" snippets expand key
imap (neocomplcache_snippets_expand)
smap (neocomplcache_snippets_expand)
"-----------------------------------------------------------------
" plugin - matchit.vim 瀵�%鍛戒护杩涜鎵╁睍浣垮緱鑳藉湪宓屽鏍囩鍜岃鍙ヤ箣闂磋烦杞�
" % 姝e悜鍖归厤 g% 鍙嶅悜鍖归厤
" [% 瀹氫綅鍧楅 ]% 瀹氫綅鍧楀熬
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - vcscommand.vim 瀵�%鍛戒护杩涜鎵╁睍浣垮緱鑳藉湪宓屽鏍囩鍜岃鍙ヤ箣闂磋烦杞�
" SVN/git绠$悊宸ュ叿
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin 鈥� a.vim
"-----------------------------------------------------------------