锘??xml version="1.0" encoding="utf-8" standalone="yes"?> [杞創]鏈浣硋im鎶宸?br>鏂囦歡鍘熺綉鍧錛?BBS 姘存湪娓呭崕绔?smth.org # 鏈浣硋im鎶宸?br>---------------------------------------- # 璇戦噴錛氬師鐞嗭細鍦╲isual妯″紡涓嬶紝"zd 鎶婁竴涓変腑鐨勫尯鍩熷懡鍚嶄負z 鐒跺悗鍒犻櫎錛?br># i 榪涘叆鎻掑叆妯″紡錛岃緭鍏ワ紝<C-R>z 鎾ら攢鍒氭墠鐨勫垹闄?鐒跺悗鍐嶅啓鍏ワ紝 # 璇戦噴錛?z 鍛戒護鍒涘緩涓涓変腑鐨勫尯鍩熶負register錛屽茍鎶婂畠鍛藉悕涓簔 # 璇戦噴錛氭洿浠や漢寮蹇冪殑鏈夛細鍦╲isual妯″紡涓嬮変腑鍑犺錛岀劧鍚庤緭鍏?2> , :vmap st "zdi<?= <C-R>z ?><ESC> :鍦╲isual妯″紡涓嬮変腑鐨勬枃瀛楀墠鍚庡垎鍒姞涓?lt;?= 鍜??> :autocmd BufEnter * lcd %:p:h : 鑷姩鏇存敼鍒板綋鍓嶆枃浠舵墍鍦ㄧ殑鐩綍 guw : 瀛楀ぇ鍐?鐙箟瀛? 璇戞敞錛氬緩璁姣攊w vEU : 瀛楀ぇ鍐?騫夸箟瀛? ggguG : 鎶婃暣涓枃绔犲叏閮ㄥ皬鍐欙紙ft!bt!錛?br>gf : 鍙栧綋鍓嶅厜鏍囧鐨勫箍涔夊瓧浣滀負鏂囦歡鍚嶏紝鐒跺悗璇曞浘鎵撳紑瀹冿紒 ga : 鏄劇ず鍏夋爣澶勫瓧絎︾殑ascii,hex,oct,...鏅曡彍鐨勪竴鍫嗚漿鎹?br>ggVGg? : 鐢╮ot13緙栫爜鏁翠釜鏂囦歡錛堟檿錛侊級 <C-A>,<C-X> : 澧炲姞,鍑忓皯 鍏夋爣澶勭殑鐙箟瀛楁墍琛ㄧず鐨勬暟瀛?br>:錛?浠呬粎鏄垎鍓蹭簡榪欎袱涓懡浠わ紝涓嶆槸鍛戒護鐨勪竴閮ㄥ垎錛?br>: Win32鐨勭敤鎴峰彲鑳介渶瑕侀噸鏂板畾涔変竴涓婥trl-A錛屽懙鍛?br># 璇戞敞錛歡ood guy, 浠や漢涓嶅緱涓嶆兂鍒皃erl鐨勬暟瀛楃涓?/p>
<C-R>=5*5 : 鎻掑叆25 (榪欐槸涓涓糠浣犺綆楀櫒鑰訛紒) # 寮曠敤鏍囪鐨勬柟娉曪細'a 錛屽嵆錛氬崟寮曞彿鍔犳爣璁板悕 :map <f8> :r /path/file :map , : 鍒楀嚭浠ラ楀彿寮濮嬬殑閿洏鏄犲儚 # 鍦ㄩ敭鐩樻槧鍍忎腑甯哥敤鐨勮〃紺?br><CR> : 鍥炶濺 yy@" : 鐢ㄤ笂闈㈡墍鎻愬埌鐨勯偅涓尶鍚峳egister # 浣跨敤澶栭儴紼嬪簭sort榪涜鎺掑簭(sort鏄疷nix鏍囧噯鍛戒護錛宭s,date涔熸槸) :'a,'b!sort -u : 瀵筸ark a 鍒癿ark b涓棿鐨勫唴瀹硅繘琛屾帓搴?br>!1} sort -u : 鎺掑簭褰撳墠孌佃惤 (鍙兘鍦╪ormal妯″紡涓嬩嬌鐢?!) : 鍙紪杈戞枃浠剁殑buffer錛岀劧鍚庢彁紺轟綘杈撳叆buffer鐨勫簭鍙鳳紝 :set hidden : 鍏佽涓嶄繚瀛榖uffer鑰屽垏鎹uffer (w/o=without) :nmap ,i :update<CR>: !start c:\progra~1\intern~1\iexplore.exe <cWORD><CR> gvim ftp://209.51.134.122/public_html/index.html # 鍦╲isual妯″紡涓嬬緝榪?(鏃犻檺鍙噸澶? :vmap <silent> g/ y/<C-R>=escape(@", '\\/.*$^~[]')<CR><CR> : with spec chars # 璺ㄨ鍖歸厤錛孿_ 琛ㄧず鍏佽鍖歸厤鎹㈣絎︼紝鎴栬呰錛屽厑璁稿尮閰嶆柊琛?br># 璇戞敞錛氬皬蹇冿紝鍜宲erl涓嶄竴鏍?br>/<!--\_p\{-}--> : 鍖歸厤澶氳娉ㄩ噴 # 鏌ユ壘褰撳墠鍏夋爣浣嶇疆鎵鍦ㄥ瓙渚嬬▼/鍑芥暟(subroutine/function)鐨勫0鏄?br>:nmap gx yiw/^\(sub\<bar>function\)\s\+<C-R>"<CR> # 鍦ㄥ涓枃妗d腑鎼滅儲 :argdo /searchstr :%s/fred/joe/igc : 涓涓父瑙佺殑鏇挎崲鍛戒護錛屼慨楗扮igc鍜宲erl涓竴鏍鋒剰鎬?br>:%s/\r//g : 鍒犻櫎DOS鏂瑰紡鐨勫洖杞M # 鍒楀鍒?br># 璇戞敞錛欯#%&^#*^%#$! # 鎴栬?br>:%s/suck\|buck/loopy/gc : 鎴栬?鎴栬呴渶瑕乗錛宖t錛侊紝|涓嶆槸鎴栬? # 璋冪敤VIM鍑芥暟 # 澶勭悊鍒楋紝鏇挎崲鎵鏈夊湪絎笁鍒椾腑鐨剆tr1 # 浜ゆ崲絎竴鍒楀拰鏈鍚庝竴鍒?(鍏?鍒? # filter all form elements into paste register ---------------------------------------- # 鍏ㄥ眬鍛戒護 (鍏跺畠) # incrementing numbers :.,$g/^\d/exe "norm \<c-p>" : Win32涓嬪繀欏婚噸瀹氫箟Ctrl-A # 淇濆瓨鍏ㄥ眬鍛戒護鐨勭粨鏋?(娉ㄦ剰蹇呴』浣跨敤娣誨姞妯″紡) # 澶嶅埗姣忎竴琛岋紝鐒跺悗鍦ㄥ鍒跺嚭鏉ョ殑姣忎竴琛屼袱渚у姞涓婁竴涓?print '澶嶅埗鍑烘潵鐨勫唴瀹? # 鎸囧嚭鎵撳紑涔嬪悗鎵ц鐨勫懡浠?br>gvim.exe -c "/main" joe.c : 鎵撳紑joe.c錛岀劧鍚庤煩杞埌'main' # 瀵逛竴涓枃浠舵墽琛屽涓懡浠?br>vim -c "%s/ABC/DEF/ge | update" file1.c # 瀵逛竴緇勬枃浠舵墽琛屽涓懡浠?br>vim -c "argdo %s/ABC/DEF/ge | update" *.c # 鑷姩緙栬緫鏂囦歡 (緙栬緫鍛戒護搴忓垪Ex commands宸茬粡鍖呭惈鍦╟onvert.vim涓簡) # 涓嶈鍔犺澆.vimrc鍜屼換浣昿lugins (嬋媧諱竴涓共鍑鐨刅IM) ---------------------------------------- #浠庝換鎰忚寮濮嬬紪鍙?闇瑕乸erl錛屽樋鍢? qqmnYP`n^Aq : 璁板綍鍒皅 鐒跺悗鐢?@q 閲嶅 # 閫掑宸插瓨鍦ㄦ暟瀛楀埌鏂囦歡鏈?br>:.,$g/^\d/exe "normal! \<c-a>" # 楂樼駭閫掑錛岀湅錛?br>http://vim.sourceforge.net/tip_view.php?tip_id=150 :X : 鐒跺悗vim浼氭彁紺轟綘杈撳叆瀵嗙爜 :g/^/ call Del() #浣跨敤璇ュ嚱鏁扮殑涓涓緥瀛?br>----------------------------------------
]]
[]
鍐嶅姞涓?br>][
涓鍏辨槸 4 涓湪孌佃惤錛堝浜?C 鏉ヨ灝辨槸鍑芥暟錛夐棿璺寵漿鐨勫懡浠ゃ?br>
鎬葷粨鏄細
1錛岀浉鍚屽氨璺沖埌鍑芥暟鐨勫紑澶達細錛堝鏋滈兘鏄乏鎷彿鎴栬呴兘鏄彸鎷彿錛夛紝涓嶅悓灝辮煩鍒板嚱鏁扮殑緇撳熬錛?br> { 鍜?} 鐢ㄦ潵璺沖埌鍑芥暟鐨勫紑澶淬?br> [] 鍜?][ 鐢ㄦ潵璺沖埌鍑芥暟鐨勭粨灝俱?br>2錛屽乏鍙沖乏鍙籌紝“宸?#8221;鍦ㄥ墠闈€傚墠鍚庡墠鍚庯紝“鍓?#8221;涔熷湪鍓嶉潰銆傚洜姝ゅ乏鎷彿鎵撳ご鍒欒〃紺哄悜鍓嶏紝鍙蟲嫭鍙鋒墦澶村垯琛ㄧず鍚戝悗錛?br> [[ 鍜?[] 鐢ㄦ潵鍚戝墠璺?br> ]] 鍜?][ 鐢ㄦ潵鍚戝悗璺?br>
緇撳悎璧鋒潵灝辨槸錛?br>[[ 鐢ㄦ潵璺沖埌鍏夋爣鍓嶉潰鐨勪竴涓嚱鏁板紑濮嬪銆傚鏋滃厜鏍囧湪鍑芥暟浣撳唴鐨勮瘽錛岄偅灝辨槸鎵鍦ㄥ嚱鏁扮殑寮濮嬪銆?br>][ 鐢ㄦ潵璺沖埌鍏夋爣鍚庨潰鐨勪竴涓嚱鏁扮粨灝懼銆傚鏋滃厜鏍囧湪鍑芥暟浣撳唴鐨勮瘽錛岄偅灝辨槸鎵鍦ㄥ嚱鏁扮殑緇撳熬澶勩?br>]] 鐢ㄦ潵璺沖埌鍏夋爣鍚庨潰鐨勪竴涓嚱鏁板紑濮嬪銆傚鏋滃厜鏍囧湪鍑芥暟浣撳唴鐨勮瘽錛岄偅灝辨槸涓嬩竴涓嚱鏁扮殑寮濮嬪銆?br>[] 鐢ㄦ潵璺沖埌鍏夋爣鍓嶉潰鐨勪竴涓嚱鏁扮粨灝懼銆傚鏋滃厜鏍囧湪鍑芥暟浣撳唴鐨勮瘽錛岄偅灝辨槸涓婁竴涓嚱鏁扮殑緇撳熬澶勩?
1錛屽厛鎯蟲槸鎯沖線鍓嶈煩錛岃繕鏄線鍚庤煩錛?br>濡傛灉鏄兂寰鍓嶏紝灝辨憗 [錛屽鏋滄槸鎯沖線鍚庯紝灝辨憗 ]錛岀劧鍚庢寚澶村埆鏉懼紑銆?br>2錛屽啀鎯蟲槸鎯沖埌寮濮嬪錛岃繕鏄粨灝懼錛?br>濡傛灉鏄紑濮嬪錛屽氨鍐嶆憗涓涓嬨傚鏋滄槸緇撳熬澶勶紝灝辨憗鍙︿竴涓敭銆?
]]>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 璁懼畾榛樿瑙g爜
set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936
" 涓嶈浣跨敤vi鐨勯敭鐩樻ā寮忥紝鑰屾槸vim鑷繁鐨?
set nocompatible
" history鏂囦歡涓渶瑕佽褰曠殑琛屾暟
set history=100
" 鍦ㄥ鐞嗘湭淇濆瓨鎴栧彧璇繪枃浠剁殑鏃跺欙紝寮瑰嚭紜
set confirm
" 涓巜indows鍏變韓鍓創鏉?
set clipboard+=unnamed
" 渚︽祴鏂囦歡綾誨瀷
filetype on
" 杞藉叆鏂囦歡綾誨瀷鎻掍歡
filetype plugin on
" 涓虹壒瀹氭枃浠剁被鍨嬭澆鍏ョ浉鍏崇緝榪涙枃浠?
filetype indent on
" 淇濆瓨鍏ㄥ眬鍙橀噺
set viminfo+=!
" 甯︽湁濡備笅絎﹀彿鐨勫崟璇嶄笉瑕佽鎹㈣鍒嗗壊
set iskeyword+=_,$,@,%,#,-
" 璇硶楂樹寒
syntax on
" 楂樹寒瀛楃錛岃鍏朵笉鍙?00鍒楅檺鍒?
:highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
:match OverLength '\%101v.*'
" 鐘舵佽棰滆壊
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鏂囦歡璁劇疆
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 涓嶈澶囦喚鏂囦歡錛堟牴鎹嚜宸遍渶瑕佸彇鑸嶏級
set nobackup
" 涓嶈鐢熸垚swap鏂囦歡錛屽綋buffer琚涪寮冪殑鏃跺欓殣钘忓畠
setlocal noswapfile
set bufhidden=hide
" 瀛楃闂存彃鍏ョ殑鍍忕礌琛屾暟鐩?
set linespace=0
" 澧炲己妯″紡涓殑鍛戒護琛岃嚜鍔ㄥ畬鎴愭搷浣?
set wildmenu
" 鍦ㄧ姸鎬佽涓婃樉紺哄厜鏍囨墍鍦ㄤ綅緗殑琛屽彿鍜屽垪鍙?
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)
" 鍛戒護琛岋紙鍦ㄧ姸鎬佽涓嬶級鐨勯珮搴︼紝榛樿涓?錛岃繖閲屾槸2
set cmdheight=2
" 浣垮洖鏍奸敭錛坆ackspace錛夋甯稿鐞唅ndent, eol, start絳?
set backspace=2
" 鍏佽backspace鍜屽厜鏍囬敭璺ㄨ秺琛岃竟鐣?
set whichwrap+=<,>,h,l
" 鍙互鍦╞uffer鐨勪換浣曞湴鏂逛嬌鐢ㄩ紶鏍囷紙綾諱技office涓湪宸ヤ綔鍖哄弻鍑婚紶鏍囧畾浣嶏級
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" 鍚姩鐨勬椂鍊欎笉鏄劇ず閭d釜鎻村姪绱㈤┈閲屽効绔ョ殑鎻愮ず
set shortmess=atI
" 閫氳繃浣跨敤: commands鍛戒護錛屽憡璇夋垜浠枃浠剁殑鍝竴琛岃鏀瑰彉榪?
set report=0
" 涓嶈vim鍙戝嚭璁ㄥ帉鐨勬淮婊村0
set noerrorbells
" 鍦ㄨ鍒嗗壊鐨勭獥鍙i棿鏄劇ず絀虹櫧錛屼究浜庨槄璇?
set fillchars=vert:\ ,stl:\ ,stlnc:\
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鎼滅儲鍜屽尮閰?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 楂樹寒鏄劇ず鍖歸厤鐨勬嫭鍙?
set showmatch
" 鍖歸厤鎷彿楂樹寒鐨勬椂闂達紙鍗曚綅鏄崄鍒嗕箣涓縐掞級
set matchtime=5
" 鍦ㄦ悳绱㈢殑鏃跺欏拷鐣ュぇ灝忓啓
set ignorecase
" 涓嶈楂樹寒琚悳绱㈢殑鍙ュ瓙錛坧hrases錛?
set nohlsearch
" 鍦ㄦ悳绱㈡椂錛岃緭鍏ョ殑璇嶅彞鐨勯愬瓧絎﹂珮浜紙綾諱技firefox鐨勬悳绱級
set incsearch
" 杈撳叆:set list鍛戒護鏄簲璇ユ樉紺轟簺鍟ワ紵
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$
" 鍏夋爣縐誨姩鍒癰uffer鐨勯《閮ㄥ拰搴曢儴鏃朵繚鎸?琛岃窛紱?
set scrolloff=3
" 涓嶈闂儊
set novisualbell
" 鎴戠殑鐘舵佽鏄劇ず鐨勫唴瀹癸紙鍖呮嫭鏂囦歡綾誨瀷鍜岃В鐮侊級
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
" 鎬繪槸鏄劇ず鐘舵佽
set laststatus=2
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鏂囨湰鏍煎紡鍜屾帓鐗?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鑷姩鏍煎紡鍖?
set formatoptions=tcrqn
" 緇ф壙鍓嶄竴琛岀殑緙╄繘鏂瑰紡錛岀壒鍒傜敤浜庡琛屾敞閲?
"set autoindent
" 涓篊紼嬪簭鎻愪緵鑷姩緙╄繘
set smartindent
" 浣跨敤C鏍峰紡鐨勭緝榪?
set cindent
" 鍒惰〃絎︿負4
set tabstop=4
" 緇熶竴緙╄繘涓?
set softtabstop=4
set shiftwidth=4
" 涓嶈鐢ㄧ┖鏍間唬鏇垮埗琛ㄧ
set noexpandtab
" 涓嶈鎹㈣
set nowrap
" 鍦ㄨ鍜屾寮濮嬪浣跨敤鍒惰〃絎?
set smarttab
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags鐨勮瀹?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鎸夌収鍚嶇О鎺掑簭
let Tlist_Sort_Type = "name"
" 鍦ㄥ彸渚ф樉紺虹獥鍙?
let Tlist_Use_Right_Window = 1
" 鍘嬬緝鏂瑰紡
let Tlist_Compart_Format = 1
" 濡傛灉鍙湁涓涓猙uffer錛宬ill紿楀彛涔焝ill鎺塨uffer
let Tlist_Exist_OnlyWindow = 1
" 涓嶈鍏抽棴鍏朵粬鏂囦歡鐨則ags
let Tlist_File_Fold_Auto_Close = 0
" 涓嶈鏄劇ず鎶樺彔鏍?
let Tlist_Enable_Fold_Column = 0
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 鍙湪涓嬪垪鏂囦歡綾誨瀷琚睛嫻嬪埌鐨勬椂鍊欐樉紺鴻鍙鳳紝鏅氭枃鏈枃浠朵笉鏄劇ず
if has("autocmd")
autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o/*<ESC>'>o*/
autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
" F5緙栬瘧鍜岃繍琛孋紼嬪簭錛孎6緙栬瘧鍜岃繍琛孋++紼嬪簭
" 璇鋒敞鎰忥紝涓嬭堪浠g爜鍦╳indows涓嬩嬌鐢ㄤ細鎶ラ敊
" 闇瑕佸幓鎺?/榪欎袱涓瓧絎?
" C鐨勭紪璇戝拰榪愯
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
" C++鐨勭紪璇戝拰榪愯
map <F6> :call CompileRunGpp()<CR>
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
" 鑳藉婕備寒鍦版樉紺?NFO鏂囦歡
set encoding=utf-8
function! SetFileEncodings(encodings)
let b:myfileencodingsbak=&fileencodings
let &fileencodings=a:encodings
endfunction
function! RestoreFileEncodings()
let &fileencodings=b:myfileencodingsbak
unlet b:myfileencodingsbak
endfunction
au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single
au BufReadPost *.nfo call RestoreFileEncodings()
" 楂樹寒鏄劇ず鏅歵xt鏂囦歡錛堥渶瑕乼xt.vim鑴氭湰錛?
au BufRead,BufNewFile * setfiletype txt
" 鐢ㄧ┖鏍奸敭鏉ュ紑鍏蟲姌鍙?
set foldenable
set foldmethod=manual
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
" minibufexpl鎻掍歡鐨勪竴鑸緗?
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
]]>
]]>
2003-3-23
--------------------------------------------------------------------------------
鍘熶綔鑰咃細d.j.rayner (zzapper)
緲昏瘧錛歨misty (%20%20
2003-3-23
# 淇℃伅鏉ユ簮
----------------------------------------
www.vim.org : 瀹樻柟绔欑偣
comp.editors : 鏂伴椈緇?br>http://www.newriders.com/books/opl/ebooks/0735710015.html : Vim涔︾睄
http://vimdoc.sourceforge.net/cgi-bin/vim2html2.pl : 鍏充簬vim鐨勫彲鏌ヨ鏂囨。
http://vimdoc.sourceforge.net/vimfaq.html : VIM FAQ
----------------------------------------
# 鍩虹
----------------------------------------
* # g* g# : 瀵繪壘鍏夋爣澶勭殑鐙箟鍗曡瘝(<cword>) (鍓嶅悜/鍚庡悜)
% : 鎷彿閰嶅瀵繪壘 {}[]()
matchit.vim : 浣垮緱 % 鑳藉閰嶅鏍囪
<script> <?php 絳夌瓑
<C-N><C-P> : 鎻掑叆妯″紡涓嬬殑鍗曡瘝鑷姩瀹屾垚
<C-X><C-L> : 琛岃嚜鍔ㄥ畬鎴?瓚呯駭鏈夌敤)
/<C-R><C-W> : 鎶婄嫮涔夊崟璇?<cword> 鍐欏埌 鎼滅儲鍛戒護 琛?br>/<C-R><C-A> : 鎶婂箍涔夊崟璇?<cWORD> 鍐欏埌 鎼滅儲鍛戒護 琛?br>:set ignorecase : 鎼滅儲鏃跺拷鐣ュぇ灝忓啓
:syntax on : 鍦?Perl,HTML,PHP 絳変腑榪涜璇硶鐫鑹?br>:h regexp<C-D> : 鎸変笅 control-D 閿嵆鍙緱鍒板寘鍚湁 regexp 鐨勫府鍔╀富棰樼殑鍒楄〃
: (浣跨敤TAB鍙互瀹炵幇甯姪鐨勮嚜鍔ㄨˉ榻?
----------------------------------------
# 浣挎洿鏂?_vimrc 鏇村鏄?br>:nmap ,s :source $VIM/_vimrc
# 璇戦噴錛歯map 鏄粦瀹氫竴涓湪normal妯″紡涓嬬殑蹇嵎閿?br>:nmap ,v :e $VIM/_vimrc
# 璇戦噴錛氬湪normal妯″紡涓嬶紝鍏堝悗鎸変笅 ,s 涓や釜閿墽琛宊vimrc錛岃?,v 鍒欐槸緙栬緫_vimrc
----------------------------------------
# visual 妯″紡 (渚嬪瓙鏄細杞繪澗娣誨姞鍏跺畠鐨?HTML Tags)
:vmap sb "zdi<C-R>z<ESC> :鍦╲isual妯″紡涓嬮変腑鐨勬枃瀛楀墠鍚庡垎鍒姞涓婂拰
# 璇戦噴錛歷map 鏄粦瀹氫竴涓湪visual妯″紡涓嬬殑蹇嵎閿?/p>
# 鏈鍚?lt;ESC>榪斿洖normal妯″紡
# 鍒欓変腑鐨勮浼氬叏閮ㄧ緝榪涗袱涓猼ab
# 555,鍋朵竴寮濮嬭繕鏄敤 :xx,xx s/^/\t\t/錛屽ソ鍌誨晩錛?/p>
----------------------------------------
# 鏂囦歡嫻忚
:Ex : 寮鍚洰褰曟祻瑙堝櫒錛屾敞鎰忛瀛楁瘝E鏄ぇ鍐欑殑
:Sex : 鍦ㄤ竴涓垎鍓茬殑紿楀彛涓紑鍚洰褰曟祻瑙堝櫒
:ls : 鏄劇ず褰撳墠buffer鐨勬儏鍐?br>:cd .. : 榪涘叆鐖剁洰褰?br>:args : 鏄劇ず鐩墠鎵撳紑鐨勬枃浠?br>:lcd %:p:h : 鏇存敼鍒板綋鍓嶆枃浠舵墍鍦ㄧ殑鐩綍
# 璇戦噴錛歭cd鏄揣绱ф敼鍙樺綋鍓嶇獥鍙g殑宸ヤ綔璺緞錛? 鏄唬琛ㄥ綋鍓嶆枃浠剁殑鏂囦歡鍚?
# 鍔犱笂 :p鎵╁睍鎴愬叏鍚嶏紙灝辨槸甯︿簡璺緞錛夛紝鍔犱笂 :h鏋愬彇鍑鴻礬寰?/p>
# 璇戦噴錛歛utocmd鎸囧畾涓涓嚜鍔ㄥ懡浠わ紝BufEnter鎸囧畾涓涓簨浠訛紝* 鎸囧畾浜嬩歡鐨勫璞★紝
# lcd %:p:h 鎸囧畾涓涓姩浣?br># hehe,濂借薄鍜屽啓璁板彊鏂囧樊涓嶅
----------------------------------------
# 緙撳啿鍖?buffer)嫻忚鍣?(絎笁鏂圭殑涓涓渶嫻佽鐨勮剼鏈?
# 闇瑕佷笅杞?bufexplorer.vim 錛?a rel=nofollow>http://www.vim.org/script.php?script_id=42 涓婂氨鏈?br>\be : 鍦ㄧ紦鍐插尯嫻忚鍣ㄤ腑鎵撳紑緙撳啿鍖哄垪琛?br>\bs : 浠ュ垎鍓茬獥鍙g殑褰㈠紡鎵撳紑緙撳啿鍖烘祻瑙堝櫒
----------------------------------------
# 澶у皬鍐欒漿鎹?br>guu : 琛屽皬鍐?br>gUU : 琛屽ぇ鍐?br>g~~ : 琛岀炕杞紙褰撶劧鎸囧ぇ灝忓啓鍟︼級
# 璇戦噴錛?g 鏄ぇ灝忓啓杞崲鍛戒護(greate)錛寀/U/~鏄笁縐嶈漿鎹㈠艦寮?灝忓啓/澶у啓/緲昏漿)錛?br># 鏈鍚庝竴涓噸澶嶅垯琛ㄧず璇ヨ漿鎹㈡槸瀵逛簬涓琛岃岃█鐨?/p>
gUw : 瀛楀皬鍐?鐙箟瀛?
g~w : 瀛楃炕杞?鐙箟瀛?
# 璇戦噴錛氭渶鍚庝竴涓獁 琛ㄧず璇ヨ漿鎹㈡槸瀵逛簬涓涓瓧鑰岃█鐨勶紝鐢變簬鏄湪normal妯″紡涓嬶紝
# 鎵浠ヨ繖涓獁 琛ㄧず涓涓嫮涔夊瓧<cword>
vE~ : 瀛楃炕杞?騫夸箟瀛?
# 璇戦噴錛歷E 榪欎釜鎸囦護緇勫悎浼氳繘鍏isual妯″紡錛岀劧鍚庨夋嫨涓涓箍涔夊瓧<CWORD>
# 璇戦噴錛氫負浠涔堟槸騫夸箟瀛楀憿錛熷洜涓鴻繖鏍峰彲浠ユ柟渚跨殑鍙栧埌璺緞鍟婏紝鍍?var/www/html/index.htm
# 璇戦噴錛歡g鍒版枃浠墮琛岄瀛楃錛孷榪涘叆Visual-Line妯″紡錛孏鍒版枃浠舵湯琛岄瀛楃錛?br># 榪欐牱灝遍変腑浜嗘暣綃囨枃绔狅紝鐒跺悗g?灝辨槸鐢╮ot13緙栫爜鏁翠釜鏂囦歡鍟?br>#
# 銆愬叧浜巖ot13鈥斺旇皝璁╄嫳鏂囨槸鍋舵暟涓瓧姣嶅晩銆?br># ROT13 鏄竴縐嶇畝鍗曠殑緙栫爜錛屽畠鎶婂瓧姣嶅垎鎴愬墠鍚庝袱緇勶紝姣忕粍13涓紝緙栫爜鍜岃瘧鐮?br># 鐨勭畻娉曠浉鍚岋紝浠呬粎浜ゆ崲瀛楁瘝鐨勮繖涓や釜閮ㄥ垎錛屽嵆錛歔a..m] --> [n..z] 鍜?[n..z]
# --> [a..m] 銆?ROT13 鐢ㄧ畝鏄撶殑鎵嬫浣垮緱淇′歡涓嶈兘鐩存帴琚瘑鍒拰闃?br># 璇伙紝涔熶笉浼氳鎼滅儲鍖歸厤紼嬪簭鐢ㄩ氬父鐨勬柟娉曠洿鎺ユ壘鍒般傜粡甯哥敤浜?USENET 涓彂琛ㄤ竴
# 浜涙敾鍑繪ф垨浠や漢涓嶅揩鐨勮█璁烘垨鏈夌畝鍗曚繚瀵嗛渶瑕佺殑鏂囩珷銆?br># 鐢變簬 ROT13 鏄嚜閫嗙畻娉曪紝鎵浠ワ紝璇戠爜鍜岀紪鐮佹槸鍚屼竴涓繃紼嬨?/p>
----------------------------------------
# 濂界帺鐨勪笢涓?br>:h 42 : 涔熷彲浠ヨ闂?http://www.google.com/search?q=42
: 絎竴涓粨鏋滃氨鏄?News. Douglas Adams 1952 - 2001.
: Floor 42 extends its deepest sympathies to
: the family, friends, and fans of Douglas Adams.
:h holy-grail
:h!
----------------------------------------
# 鏍囪鍜岀Щ鍔?br>'. : 璺沖埌鏈鍚庝慨鏀圭殑閭d竴琛?(瓚呯駭鏈夌敤)(ft,鎬庝箞鍙堟槸榪欎釜璇勪環)
`. : 涓嶄粎璺沖埌鏈鍚庝慨鏀圭殑閭d竴琛岋紝榪樿瀹氫綅鍒頒慨鏀圭偣
<C-O> : 渚濇娌跨潃浣犵殑璺寵漿璁板綍鍚戝洖璺?(浠庢渶榪戠殑涓嬈″紑濮?
<C-I> : 渚濇娌跨潃浣犵殑璺寵漿璁板綍鍚戝墠璺?br>:ju(mps) : 鍒楀嚭浣犺煩杞殑瓚寵抗
:help jump-motions
:history : 鍒楀嚭鍘嗗彶鍛戒護璁板綍
:his c : 鍛戒護琛屽懡浠ゅ巻鍙?br>:his s : 鎼滅儲鍛戒護鍘嗗彶
q/ : 鎼滅儲鍛戒護鍘嗗彶鐨勭獥鍙?br>q: : 鍛戒護琛屽懡浠ゅ巻鍙茬殑紿楀彛
:<C-F> : 鍘嗗彶鍛戒護璁板綍鐨勭獥鍙?br>----------------------------------------
# 緙╁啓鍜岄敭鐩樻槧鍍?鍘熸枃涓枃浠朵婦渚嬮兘鐢ㄤ簡c:/aaa/x錛屽伓鍏ㄧ粰浠栨敼鎴?path/file浜嗭紝鍝煎敡)
:map <f7> :'a,'bw! /path/file
# 璇戦噴錛歮ap鏄槧鍍忎竴涓猲ormal妯″紡涓嬬殑閿?br># 榪欓噷鏄妸F7閿槧鍍忔垚鎶婃爣璁癮鍒版爣璁癰涓棿鐨勫唴瀹瑰彟瀛樹負涓涓枃浠?path/file
# 鏍囪(mark)鐨勬柟娉曪細鎶婂厜鏍囩Щ鍔ㄥ埌闇瑕佹爣璁扮殑鍦版柟錛岃緭鍏錛岀劧鍚庤緭鍏ユ爣璁板悕錛屼緥濡俛
# 璇戦噴錛氭妸F8閿槧鍍忔垚鍦ㄥ綋鍓嶄綅緗彃鍏ユ枃浠?path/file鐨勫唴瀹?br>:map <f11> :.w! /path/file2<CR>
# 璇戦噴錛?錛堢偣鍙鳳級琛ㄧず褰撳墠琛?br># 鎵浠11灝辨槸鎶婂綋鍓嶈瀛樹負/path/file2
# 鏈鍚庣殑<CR>琛ㄧず涓涓洖杞?br>:map <f12> :r /path/file2<CR>
:ab php : 鍒楀嚭php琛ㄧず鐨勭緝鍐?br># 璇戦噴錛氬畾涔変竴涓緝鍐欎嬌鐢細:iab hm hmisty
# 涓涓湁瓚g殑鐜拌薄鏄紝瀹冨垪鍑虹殑浼氭槸php鍜屽畠鐨勫墠瀛愪覆寮澶寸殑緙╁啓
# 渚嬪錛屾湁榪欎箞鍑犱釜緙╁啓錛?br># h => hmisty1 , hm => hmisty2 , hmi => hmisty3, m => hmisty4
# 閭d箞浣跨敤 :ab hm浼氭樉紺鴻繖涔堝嚑涓緝鍐欙細hm 鍜?h
# 鑰屼笉鏄綘鎯寵薄涓殑 hm 鍜?hmi
# 璇戦噴錛氫竴鑸岃█錛屾垜浠О榪欎簺閫楀彿寮濮嬬殑緇勫悎閿負銆岄楀彿鍛戒護銆?br># 涓嶈繃hmisty鏇村枩嬈㈢敤;鏋勬垚銆屽垎鍙峰懡浠ゃ?br># 鑰屼笖涓嶆槸鐢╩ap,鑰屾槸鐢╥map
# 鍥犱負鍋舵噿涔堬紝鎳掑緱鎸?lt;Esc>,鎵浠ョ洿鎺ュ湪insert妯″紡涓嬪氨鎵ц鍛戒護浜?br># 涓轟粈涔堢敤鍒嗗彿鍛紵鍥犱負鎴戞渶甯哥敤瀹冨啓紼嬪簭鍟?br># perl/C/C++/object pascal/java錛岄兘鏄敤鍒嗗彿緇撴潫涓涓鍙?br># 鎴戜滑涓鑸緢灝戝湪鍒嗗彿鍚庨潰榪炵畫鍐欏叾瀹冨瓧絎?br># 鎵浠ョ敤銆屽垎鍙鳳紜鍏跺畠閿嶅氨寰堝皯浼氬湪杈撳叆鐨勬椂鍊欓犳垚鍐茬獊
<ESC> : Esc
<LEADER> : 杞箟絎﹀彿 \
<BAR> : 綆¢亾絎﹀彿 |
----------------------------------------
# 鍒楀嚭瀵勫瓨鍣?Registers)
:reg : 鏄劇ず鎵鏈夊綋鍓嶇殑registers
"1p : "琛ㄧず寮曠敤register錛?琛ㄧず涓涓悕瀛楀彨鍋?鐨剅egister錛?br>: p灝辨槸綺樿創錛坧aste錛夊懡浠?br># 璇戦噴錛?涔熺敤鏉ュ畾涔塺egister
# 鍏堣緭鍏?",琛ㄧず瀹氫箟register
# 鐒跺悗杈撳叆鍚嶅瓧錛屽0~9,a~z
# 鐒跺悗鎵ц鍒犻櫎鎴栧鍒跺懡浠わ紝濡俤d鎴杫錛?br># 鎴栬呮槸visual妯″紡涓嬬殑d(鍒犻櫎閫変腑鐨勯儴鍒?鎴杫(澶嶅埗閫変腑鐨勯儴鍒?
# 鍒欒鍒犻櫎鎴栧鍒剁殑閮ㄥ垎灝辮瀛樺叆浜嗚繖涓懡鍚嶇殑register
#
# 瑙傚療錛氫竴涓壒孌婄殑register, "" 錛岄噷闈㈠瓨鍌ㄤ簡涓涓尶鍚嶇殑鍒犻櫎/澶嶅埗
# 鍦ㄤ綘鎵цdd鎴杫鐨勬椂鍊欙紝琚綔鐢ㄧ殑閮ㄥ垎琚瓨鍒頒簡""涓?br># 榪欎簺鍜宲erl鏄涔堝儚鍟?br>----------------------------------------
# Useful trick
"ayy@a : 鎶婂綋鍓嶈浣滀負涓涓猇im鍛戒護鏉ユ墽琛?br># 璇戦噴錛?ayy 鏄畾涔夊綋鍓嶈鍒皉egister a錛岀劧鍚嶡a鏄墽琛宺egister a涓瓨鍌ㄧ殑鎸囦護
# yy: 澶嶅埗涓琛?br># 10yy: 澶嶅埗浠庢鍚戜笅鐨?0琛?/p>
----------------------------------------
# 浠庡叾瀹冪▼搴忚幏鍙栬緭鍑?(闇瑕佸閮ㄧ▼搴?
:r!ls.exe : 璇誨彇ls鐨勮緭鍑哄埌褰撳墠浣嶇疆
!!date : 璇誨彇date鐨勮緭鍑?(浣嗘槸浼氭浛鎹㈠綋鍓嶈鐨勫唴瀹?
# 璇戦噴錛氬叾瀹炰綘杈撳叆浜?!鍚庯紝vim灝辮嚜鍔ㄨ漿鎹㈠埌 :.! 絳夊緟浣犵戶緇緭鍏?/p>
:%!sort -u : 浣跨敤sort紼嬪簭鎺掑簭鏁翠釜鏂囦歡錛堢敤緇撴灉閲嶅啓鏂囦歡錛?br># 璇戦噴錛?琛ㄧず鏁翠釜鏂囦歡鐨勬墍鏈夎
# !sort琛ㄧず鎵ц澶栭儴鍛戒護sort
# -u鏄痵ort鐨勫弬鏁幫紝man sort鐪嬬湅錛岃繖涓弬鏁扮殑鎰忎箟鏄悎騫剁浉鍚岀殑琛?br># u灝辨槸unique,濡傛灉涓よ鍐呭鐩稿悓錛屽垯緇撴灉涓彧淇濈暀涓琛岀殑璇?/p>
# 璇戦噴錛?琛ㄧず浣跨敤filter錛?}琛ㄧずfilter鐨勫璞℃槸浠庡綋鍓嶈寮濮嬪悜鍚庢暟涓孌?br># 孌佃惤鎸囧埌絀鴻澶勭粨鏉燂紝涓嶅寘鎷┖琛?br># 鍏跺疄浣犱竴鏃﹁緭鍏?!1}錛寁im灝辮嚜鍔ㄨ綆楀綋鍓嶆钀藉簲璇ュ埌閭d竴琛?eg.+5)錛岀劧鍚庣敓鎴?br># :.,.+5! 絳夊緟涔嬪悗杈撳叆sort -u錛屽洖杞︼紝瀹屾垚鎿嶄綔
# .琛ㄧず褰撳墠琛岋紝.+5褰撶劧灝辨槸褰撳墠琛屽悜鍚庢暟5琛?br>----------------------------------------
# 澶氭枃妾旀搷浣?(鍩虹)
# 璇戞敞錛氱敤 :ls! 鍙互鏄劇ず鍑哄綋鍓嶆墍鏈夌殑buffer
:bn : 璺寵漿鍒頒笅涓涓猙uffer
:bp : 璺寵漿鍒頒笂涓涓猙uffer
:wn : 瀛樼洏褰撳墠鏂囦歡騫惰煩杞埌涓嬩竴涓?鍙堟槸銆岃秴綰?.....銆?ft!)
:wp : 瀛樼洏褰撳墠鏂囦歡騫惰煩杞埌涓婁竴涓?br>:bd : 鎶婅繖涓枃浠朵粠buffer鍒楄〃涓仛鎺?br>:bun : 鍗告帀buffer (鍏抽棴榪欎釜buffer鐨勭獥鍙d絾鏄笉鎶婂畠浠庡垪琛ㄤ腑鍋氭帀)
:badd file.c : 鎶婃枃浠秄ile.c娣誨姞鍒癰uffer鍒楄〃
:b 3 : 璺沖埌絎?涓猙uffer
:b main : 璺沖埌涓涓悕瀛椾腑鍖呭惈main鐨刡uffer,渚嬪main.c
: (ultra錛岃繖涓庝箞緲昏瘧錛?()
:sav php.html : 鎶婂綋鍓嶆枃浠跺瓨涓簆hp.html騫舵墦寮php.html
:sav! %<.bak : 鎹竴涓悗緙淇濆瓨
:e! : 榪斿洖鍒頒慨鏀逛箣鍓嶇殑鏂囦歡(淇敼涔嬪悗娌℃湁瀛樼洏)
:w /path/% : 鎶婃枃浠跺瓨鍒頒竴涓湴鍎?br>:e # : 緙栬緫鏍囪涓?鐨刡uffer(榪欎釜buffer蹇呴』鍚湁涓涓彲緙栬緫鐨勬枃浠?
: 鐢╨s鍛戒護灝辮兘鐪嬪埌鍝竴涓猙uffer鏈?
: %a琛ㄧず褰撳墠姝e湪緙栬緫鐨刡uffer
: u 琛ㄧず涓嶈兘緙栬緫鎴栬呭凡緇忚鍋氭帀鐨刡uffer
:e #3 : 緙栬緫緙栧彿涓?鐨刡uffer(榪欎釜buffer蹇呴』鍚湁涓涓彲緙栬緫鐨勬枃浠?
:rew : 鍥炲埌絎竴涓彲緙栬緫鐨勬枃浠?br>:brew : 鍥炲埌絎竴涓猙uffer
:sp fred.txt : 鍦ㄤ竴涓按騫沖垎鍓茬殑紿楀彛涓墦寮鏂囦歡fred.txt
# 璇戞敞錛歷s fred.txt鍙互瀹炵幇鍨傜洿鍒嗗壊
:sball : 鎶婂綋鍓嶆墍鏈夊惈鏈夊彲緙栬緫鏂囦歡鐨刡uffer鏄劇ず鍒頒竴涓垎鍓茬獥鍙d腑
: (鍋惰鑰冭檻鎶妔uper緲昏瘧鎴?楂樼駭鎸囦護 浜?ft)
:map <F5> :ls<CR>:e # : 鍦╪ormal妯″紡涓嬫寜F5閿紝鍒欎細鏄劇ず鎵鏈夊惈鏈変竴涓?/p>
: 杈撳叆鍚庡洖杞︼紝鍒欑紪杈戣繖涓猙uffer
# 璇戞敞錛氳繖鏄竴涓敭鐩樼粦瀹?/p>
----------------------------------------
# 鍦ㄥ垎鍓茬獥鍙d腑蹇熷垏鎹?br>:map <C-J> <C-W>j<C-W>_
# 璇戞敞錛氬師鏂囨澶勬湁璇紝鍓嶉潰搴旇鍔犱笂鍐掑彿
# 榪欐槸涓涓敭鐩樼粦瀹氾紝鎶奀trl-J瀹氫箟鎴愬垏鎹㈠埌涓嬩竴涓獥鍙e茍鏈澶у寲
:map <C-K> <C-W>k<C-W>_
----------------------------------------
# 鍛戒護褰曞埗 (鏈浣蟲妧宸э紝ft)
qq #褰曞埗鍒皅
.. #杈撳叆涓緋誨垪澶嶆潅鐨勬寚浠?br>q #鍐嶆鎸塹鍋滄褰曞埗
@q #鎵цq涓瓨鍌ㄧ殑鎸囦護
@@ #閲嶅鎵ц
# 緙栬緫register/褰曞埗
"ap #鎶妑egister a涓殑鍐呭璐村埌褰撳墠浣嶇疆
.. #鐜板湪浣犲彲浠ヤ慨鏀瑰畠浜?br>"add#鍒犻櫎涔嬶紝閲嶆柊瀛樺叆register a
@a #鎵цregister a涓殑鎸囦護
----------------------------------------
# _vimrc鍩虹
:set incsearch : 瀹炴椂鍖歸厤浣犺緭鍏ョ殑鍐呭
:set wildignore=*.o,*.obj,*.bak,*.exe : tab閿殑鑷姩瀹屾垚鐜板湪浼氬拷鐣ヨ繖浜?br>:set shiftwidth=4 : 鐜板湪鑷姩緙╄繘灝嗘槸4涓瓧絎?br># 璇戞敞錛氫竴涓猼ab浣嶉氬父鏄?涓瓧絎?br># 鎵浠ワ紝鎴戜滑榪樿璁懼畾 :set tabstop=4錛岃繖鏍鳳紝鎵鏈夌殑緙╄繘閮芥槸4瀛楃浜?br># emacs榛樿灝辨槸4瀛楃緙╄繘鍚э紵
:set vb t_vb=". : 娌夐粯鏂瑰紡(涓嶈鍙玝eep錛?
----------------------------------------
# 鍔犺澆windows iexplorer鏉ユ祻瑙?鎴戞兂榪欏彧鏈夊湪windows涓嬬敤gvim鎵嶈兘鐢ㄥ埌)
:nmap ,f :update<CR>:silent !start c:\progra~1\intern~1\iexplore.exe file://%:p
# 璇戦噴錛歯map鏄仛涓涓猲ormal妯″紡涓嬬殑閿洏緇戝畾
# 榪欓噷緇戝畾浜嗕竴涓楀彿鍛戒護 ,f
# :update鏄啓榪欎釜鏂囦歡錛屼笌:w涓嶅悓錛屽畠鍙湁褰撴枃浠惰淇敼浜嗙殑鏃跺欐墠鍐?br># :silent鍒寮瑰嚭紿楀彛鎶ュ憡鎵ц緇撴灉
# !...鍚庨潰灝辨槸鎵цwindows鍛戒護浜嗐傚懙鍛碉紝鍘婚棶bill gates浠涔堟剰鎬濆惂銆?br># 涓嶈繃鍋剁敤gvim 6.1璇曡繃浜嗭紝濂界敤錛?/p>
----------------------------------------
# 鐢╒IM緙栬緫ftp鏂囦歡
:cmap ,r :Nread ftp://209.51.134.122/public_html/index.html
:cmap ,w :Nwrite ftp://209.51.134.122/public_html/index.html
# 璇戞敞錛氬師鏂囦涪澶變簡寮澶寸殑鍐掑彿
# cmap鏄懡浠?command)妯″紡緇戝畾
# 榪欎竴鍙ュ氨鏄紑濮嬬紪杈戜竴涓猣tp榪滅▼鐨勬枃浠訛紝ft
----------------------------------------
# 闄勫姞鍒頒竴涓猺egister (灝辨槸鐢ㄥぇ鍐欑殑register鍚嶅瓧鍟︼紒)
"a5yy #澶嶅埗5琛屽埌a涓?br>10j #涓嬬Щ10琛?br>"A5yy #鍐嶆坊鍔?琛屽埌a涓?br>----------------------------------------
[I : 鏄劇ず鍏夋爣澶勭殑鐙箟瀛楀彲浠ュ尮閰嶇殑琛?楂樼駭鎸囦護)
# 璇戞敞錛? 鍙互鍏ㄦ枃鏌ユ壘涓庡厜鏍囧鐨勭嫮涔夊瓧鐩稿尮閰嶇殑瀛楋紝
# 榪欏湪鏌ユ壘鍑芥暟鍘熷瀷鍜屽疄鐜幫紝鎴栬呭彉閲忎嬌鐢ㄧ殑鏃跺欏緢鏈夌敤
----------------------------------------
# 甯歌緙╄繘
:'a,'b>>
# 璇戦噴錛氭妸mark a鍒癿ark b涔嬮棿鐨勫唴瀹硅繘琛屼袱嬈$緝榪?/p>
:vnoremap < <gv
# 璇戦噴錛?vnoremap 閲嶅畾涔変簡visual妯″紡涓?< 絎﹀彿鐨勫惈涔?br># 鎶婂畠瀹氫箟鎴?<gv
# 鍗籌細鍏?lt;鍚戝緙╄繘錛岀劧鍚巊v閲嶆柊閫夋嫨涓婁竴嬈¢夋嫨浜嗙殑鍖哄煙
# 榪欐牱鍦╲isual妯″紡涓嬪氨鍙互瀹炵幇榪炵畫鎸?lt;鑰岃繛緇緝榪涗簡
:vnoremap > >gv
# 鍚岄噷錛屽唴緙?br>----------------------------------------
# 鏌ユ壘錛堣瘧娉細寤鴻鍏堝涔犳鍒欒〃杈懼紡錛?br># 璇戞敞錛氭煡鎵懼懡浠や笉鐢ㄨ繘鍏?鍛戒護妯″紡錛岀洿鎺ユ寜/灝卞彲浠ヤ簡
# 濡傛灉娌℃湁淇グ錛屽彲浠ヤ笉瑕佸彸杈圭殑/
# 鍜宻mth bbs宸笉澶氬暒錛屽懙鍛?br>/joe/e : 鍏夋爣鍋滅暀鍦ㄥ尮閰嶅崟璇嶆渶鍚庝竴涓瓧姣嶅
/joe/e+1 : 鍏夋爣鍋滅暀鍦ㄥ尮閰嶅崟璇嶆渶鍚庝竴涓瓧姣嶇殑涓嬩竴涓瓧姣嶅
/joe/s : 鍏夋爣鍋滅暀鍦ㄥ尮閰嶅崟璇嶇涓涓瓧姣嶅
/^joe.*fred.*bill/ : ft,鏍囧噯姝e垯琛ㄨ揪寮?br>/^[A-J]\+/ : 鎵句竴涓互A~J涓竴涓瓧姣嶉噸澶嶄袱嬈℃垨浠ヤ笂寮澶寸殑琛?br>/forum\(\_.\)*pent : 澶氳鍖歸厤
/fred\_s*joe/i : 涓棿鍙互鏈変換浣曠┖鐧斤紝鍖呮嫭鎹㈣絎n
# 璇戞敞錛氳繖涓拰perl涓嶅お涓鏍風殑鍝?br>/fred\|joe : 鍖歸厤FRED鎴朖OE
/\<fred\>/i : 鍖歸厤fred,fred蹇呴』鏄竴涓嫭绔嬬殑鍗曡瘝錛岃屼笉鏄瓙涓?br># 璇戞敞錛氳繖鍜宲erl涔熶笉澶竴鏍鳳紝perl鏄敤\b鍋氬崟璇嶅畾鐣岀鐨?br>/\<\d\d\d\d\> : 鍖歸厤4涓暟瀛?br>\<\d\{4}\> : 涔熸槸鍖歸厤4涓暟瀛?br># 鍦╲isual妯″紡涓嬫煡鎵?br>:vmap g/ y/<C-R>"<CR> : 鍖歸厤閫変腑鐨勯珮浜枃瀛?br># 璇戦噴錛歷map鏄湪visual妯″紡涓嬬殑閿洏鏄犲儚
# 鏄犲儚浜唃/榪欎釜鍛戒護緇勫悎
# y 鎶婇変腑鐨勯珮浜枃瀛楀啓鍏ュ尶鍚峳egister "
# / 鎵撳紑鎼滅儲妯″紡
# <C-R> 鍑嗗綺樿創register
# " 綺樿創浜?"涓殑鍐呭
# <CR> 鍥炶濺錛屾墽琛?/p>
# 璇戦噴錛欯#$&^*@#%&*#$@!
/fred\_s*joe/i : 浼間箮涓婇潰鏈変簡錛宖t
/bugs\(\_.\)*bunny : 涓棿鍙互鏈夋棤鏁頒笢瑗?br>:h \_ : 鐪嬬湅鍏充簬 \_ 鐨勫府鍔?/p>
# 璇戦噴錛歯map 鍋氫竴涓猲ormal妯″紡涓嬬殑閿洏緇戝畾
# y 榪涘叆澶嶅埗鐘舵侊紝鍚庨潰闇瑕佷竴涓猰otion
# 鎺ョ潃灝辯敤 iw 鎸囧嚭浜嗚繖涓猰otion,鏄痠nner word
# inner word涔熸槸鐙箟瀛?lt;cword>錛屼絾鏄拰 w 涓嶅悓
# w 鏄粠鍏夋爣浣嶇疆寮濮嬪悜鍚庣湅
# 鑰宨nner word鎬繪槸鎶婂厜鏍囩Щ鍒扮涓涓瓧姣嶏紝浠庤屾昏兘寰楀埌涓涓畬鏁寸殑鐙箟瀛?br># 璇曚竴璇?gUw 鍜?gUiw 灝辯煡閬撳尯鍒簡錛屽懙鍛點?/p>
:bufdo /searchstr
----------------------------------------
# 鏇挎崲
# 璇戞敞錛氭浛鎹㈠懡浠ら渶瑕佸厛榪涘叆:鍛戒護妯″紡
:%s= *$== : 鍒犻櫎琛屽熬絀虹櫧
:'a,'bg/fred/s/dick/joe/igc : 闈炲父鏈夌敤錛侊紙ft,鍙堟潵浜嗭紒錛?br># 璇戦噴錛?a,'b鎸囧畾涓涓寖鍥達細mark a ~ mark b
# g//鐢ㄤ竴涓鍒欒〃杈懼紡鎸囧嚭浜嗚繘琛屾搷浣滅殑琛屽繀欏誨彲浠ヨfred鍖歸厤
# 鐪嬪悗闈紝g//鏄竴涓叏灞鏄劇ず鍛戒護
# s/dick/joe/igc鍒欏浜庤繖浜涙弧瓚蟲潯浠剁殑琛岃繘琛屾浛鎹?/p>
:%s= [^ ]\+$=&&= : 澶嶅埗鏈鍚庝竴鍒?br>:%s= \f\+$=&&= : 涓鏍風殑鍔熻兘
:%s= \S\+$=&& : ft,榪樻槸涓鏍?br># 鍙嶅悜寮曠敤錛屾垨縐拌蹇?br>:s/\(.*\):\(.*\)/\2 : \1/ : 棰犲掔敤:鍒嗗壊鐨勪袱涓瓧孌?br>:%s/^\(.*\)\n\1/\1$/ : 鍒犻櫎閲嶅琛?br># 闈炶椽濠尮閰嶏紝\{-}
:%s/^.\{-}pdf/new.pdf/ : 鍙槸鍒犻櫎絎竴涓猵df
# 璺ㄨ秺鍙兘鐨勫琛?br>:%s/<!--\_.\{-}-->// : 鍙堟槸鍒犻櫎澶氳娉ㄩ噴錛堝挦錛熶負浠涔堣璇淬屽張銆嶅憿錛燂級
:help /\{-} : 鐪嬬湅鍏充簬 闈炶椽濠暟閲忕 鐨勫府鍔?br>:s/fred/<c-r>a/g : 鏇挎崲fred鎴恟egister a涓殑鍐呭錛屽懙鍛?br># 鍐欏湪涓琛岄噷鐨勫鏉傚懡浠?br>:%s/\f\+\.gif\>/\r&\r/g | v/\.gif$/d | %s/gif/jpg/
# 璇戞敞錛氬氨鏄敤 | 綆¢亾鍟?/p>
# ft, \涓嶅氨鏄漿涔変簡涔堬紒榪欎釜鍜宲erl鐪熸槸涓嶅悓浜嗭紒
:s/__date__/\=strftime("%c")/ : 鎻掑叆鏃墮棿涓?/p>
:%s:\(\(\w\+\s\+\)\{2}\)str1:\1str2:
:%s:\(\w\+\)\(.*\s\+\)\(\w\+\)$:\3\2\1:
# 鎶婃墍鏈夌殑form鍏冪礌錛堝氨鏄痟tml閲岄潰鐨刦orm鍟︼級鏀懼埌register閲岋紵
# ft, 澶寸柤錛屼笉瑙i噴浜?br>:redir @*|sil exec 'g#<\(input\|select\|textarea\|/\=form\)\>#p'|redir END
:nmap ,z :redir @*<Bar>sil exec 'g@<\(input\<Bar>select\<Bar>textarea\<Bar>/\=fo
# 涓婇潰榪欎竴琛屼笉鑳藉畬鍏ㄦ樉紺猴紝鏈濂紺opy Article涓嬪幓鐪?/p>
# 鍏ㄥ眬(global)鏄劇ず鍛戒護錛屽氨鏄敤 :g錛嬫鍒欒〃杈懼紡
# 璇戦噴錛?:g/{pattern}/{cmd} 灝辨槸鍏ㄥ眬鎵懼埌鍖歸厤鐨勮
# 鐒跺悗瀵硅繖浜涜鎵ц鍛戒護{cmd}
:g/\<fred\>/ : 鏄劇ず鎵鏈夎兘澶熶負鍗曡瘝fred鎵鍖歸厤鐨勮
:g/<pattern>/z#.5 : 鏄劇ず鍐呭錛岃繕鏈夎鍙鳳紝鍛靛懙
:g/<pattern>/z#.5|echo "==========" : 婕備寒鐨勬樉紺猴紝ft!
:g/^\s*$/d : 鍒犻櫎鎵鏈夌┖琛?br>:g!/^dd/d : 鍒犻櫎涓嶅惈瀛楃涓?dd'鐨勮
:v/^dd/d : 鍚屼笂
# 璇戦噴錛歷 == g!錛屽氨鏄笉鍖歸厤錛?br>:g/fred/,/joe/d : not line based (very powerfull)
:v/./.,/./-1join : 鍘嬬緝絀鴻
:g/^$/,/./-j : 鍘嬬緝絀鴻
:g/<input\|<form/p : 鎴栬?瑕佺敤\|
:g/^/pu _ : 鎶婃枃涓┖琛屾墿澧炰竴鍊?(pu = put)
: 鍗籌細鍘熸潵涓よ闂存湁涓涓┖琛岋紝鐜板湪鍙樻垚2涓?br>:g/^/m0 : 鎸夎緲昏漿鏂囩珷 (m = move)
:g/fred/t$ : 鎷瘋礉琛岋紝浠巉red鍒版枃浠舵湯灝?EOF)
:%norm jdd : 闅旇鍒犻櫎
# 璇戦噴錛? 鎸囨槑鏄鎵鏈夎榪涜鎿嶄綔
# norm鎸囧嚭鍚庨潰鏄痭ormal妯″紡鐨勬寚浠?br># j鏄笅縐諱竴琛岋紝dd鏄垹闄よ
:.,$g/^\d/exe "norm! \<c-a>" : 澧炲姞鍦˙OL(beginning of line)澶勭殑鏁板瓧
# 璇戞敞錛?,$ 鎸囨槑鍛戒護浠庡綋鍓嶈鎵ц鍒版渶鍚庝竴琛?br># 濡傛灉娌℃湁 .,$ 闄愬畾鑼冨洿錛岄偅涔坓//灝變細瀵規暣涓枃浠惰繘琛屾搷浣?br># exe 鏄墽琛屽悗闈㈢殑鍛戒護緇勫悎
:g/fred/y A : 娣誨姞鎵鏈変負fred鎵鍖歸厤鐨勮鍒皉egister a
:'a,'b g/^Error/ . w >> errors.txt
:g/./yank|put|-1s/'/"/g|s/.*/Print '&'/
----------------------------------------
# 鍏ㄥ眬鍛戒護鍜屾浛鎹㈠懡浠よ仈濮?(寮哄ぇ鐨勭紪杈戣兘鍔?
:'a,'bg/fred/s/joe/susan/gic : 鍙互浣跨敤鍙嶅悜寮曠敤鏉ュ尮閰?br>:g/fred/,/joe/s/fred/joe/gic : non-line based (ultra)
----------------------------------------
# 鍏堟壘fred錛岀劧鍚庢壘joe錛岀劧鍚?a href="mailto:#$^$%^#$%^@%^%&">#$^$%^#$%^@%^%&%^*!
:/fred/;/joe/-2,/sid/+3s/sally/alley/gIC
----------------------------------------
# 澶嶄綅鍚戝埌register * 鍜?綺樿創register *
:redir @* : 澶嶄綅鍚戝懡浠ょ殑杈撳嚭緇撴灉錛堟渶涓嬫柟鍛戒護琛屼笂鐨勭粨鏋滐級
: 鍒皉egister * (ft,* 浠h〃0~1,a~z,..)
:redir END : 緇撴潫澶嶄綅鍚?br># 澶勭悊綺樿創
"*yy : 涓婇潰璁茶繃浜嗭紝灝辨槸澶嶅埗鍒皉egister *涓?br>"*p : 鐒跺悗璐村嚭鏉?br>----------------------------------------
:redir >> out.txt : 澶嶄綅鍚戝埌涓涓枃浠?br>----------------------------------------
# 閲嶆柊鏍煎紡鍖栨枃鏈?br>gq<CR>
gqap (a鏄痬otion p鏄钀?visual妯″紡))
ggVGgq 閲嶆柊鏍煎紡鍖栨暣涓枃绔?br>----------------------------------------
# 瀵瑰涓枃妗e疄鏂藉懡浠?br>:argdo %s/foo/bar/ : 瀵規墍鏈?args鍒楄〃涓殑鏂囨。鎵ц鍛戒護
:bufdo %s/foo/bar/
:windo %s/foo/bar/
:argdo exe '%!sort'|w! : 浣跨敤澶栭儴鍛戒護
----------------------------------------
# 鍛戒護琛岀殑涓浜涘ソ鐜╃殑涓滀笢
gvim -h : 嬋媧葷殑鏃跺欐縺媧誨府鍔?Win32)
vi -h 鎴?vim -h : 榪欎釜鏄痷nix涓嬬敤
ls | gvim - : 緙栬緫涓涓暟鎹祦錛?br>gvim -o file1 file2 : 浠ュ垎鍓茬獥鍙f墦寮涓や釜鏂囦歡
vim -s "convert.vim" file.c
gvim -u NONE -U NONE -N
----------------------------------------
# GVIM 涓嶅悓鐨勫湴鏂?br>gvim -d file1 file2 : vimdiff (姣旇緝涓嶅悓)
dp : 鎶婂厜鏍囧鐨勪笉鍚屾斁鍒板彟涓涓枃浠?br>do : 鍦ㄥ厜鏍囧浠庡彟涓涓枃浠跺彇寰椾笉鍚?br>----------------------------------------
# Vim闄烽槺
# 鍦╲im鐨勬鍒欒〃杈懼紡涓紝 + 鍜?| 閮藉繀欏誨姞杞箟絎?\
# 灝忓績錛岃繖鍜宲erl涓嶄竴鏍鳳紒
/fred\+/ : 鍖歸厤fred鎴杅reddy浣嗘槸涓嶅尮閰峟ree
----------------------------------------
# \v 錛屾垨鍙仛very magic (閫氬父閮芥槸榪欎箞鍙?鍙互鍙栨秷杞箟絎?br>/codes\(\n\|\s\)*where : 鏅氱殑姝e垯琛ㄨ揪寮?br>/\vcodes(\n|\s)*where : very magic錛寍 涓嶇敤鍔?\ 浜嗭紒
# 鎶婁笢瑗塊佸埌鍛戒護琛?鎼滅儲琛?(SUPER:鍋朵笉鍐嶇炕璇戣繖縐嶅徆璇嶄簡)
<C-R><C-W> : 閫佷竴涓嫮涔夎瘝
<C-R><C-A> : 閫佷竴涓箍涔夎瘝
<C-R>- : 閫佷竴涓皬鍨嬪垹闄ゅ瘎瀛樺櫒register
<C-R>[0-9a-z] : 閫佷竴涓懡鍚嶅瘎瀛樺櫒register
<C-R>% : 閫佹枃浠跺悕榪囧幓 (#涔熻)
----------------------------------------
# 鎿嶄綔瀵勫瓨鍣?br>:let @a=@_ : 娓呴櫎register a
:let @*=@a : 瀵勫瓨鍣ㄨ祴鍊?br>:map <f11> "qyy:let @q=@q."zzz"
# 璇戞敞錛氱寽鐚滆繖涓棤鑱婄殑緇戝畾鏄粈涔堟剰鎬濓紵
----------------------------------------
# 鍏充簬甯姪鐨勫府鍔?br>:h quickref : 緲誨埌VIM Quick Reference欏?鏈夌敤錛?
:h tips : Vim鑷繁鐨則ips
:h visual<C-D><tab> : 寰楀埌涓涓叧浜巚isual鍏抽敭璇嶇殑甯姪鍒楄〃
: 鐒跺悗鐢╰ab閿幓閫夋嫨
:h ctrl<C-D> : 鏄劇ず鎵鏈夊叧浜嶤trl鐨勫府鍔?br>:h :r : :ex鍐掑彿鍛戒護
:h CTRL-R : 鏅氭ā寮忓懡浠?br>:h \r : \r鍦ㄦ鍒欒〃杈懼紡涓槸浠涔堟剰鎬濆憿錛?br>:h i_CTRL-R : insert妯″紡涓嬬殑Ctrl-R
:h c_CTRL-R : 鍛戒護琛?command-line)妯″紡涓嬬殑Ctrl-R
:h v_CTRL-V : visual妯″紡涓嬬殑Ctrl-V
:h tutor : VIM 鎸囧崡
gvim -h : 鍏充簬 VIM 鍛戒護鐨勫府鍔?br>vi/vim -h
<C-S>T : Control Shift T go backwards in help
: 鍋朵笉娓呮鏈変粈涔堢敤:(
----------------------------------------
# 閫夐」璁劇疆鍦ㄥ摢閲岋紵
:scriptnames : 鍒楀嚭鎵鏈夊姞杞界殑 plugins, _vimrcs
:verbose set history : 鏄劇ずhistory鐨勫煎茍鎸囧嚭璁劇疆鏂囦歡鐨勪綅緗?br>----------------------------------------
# 鍒朵綔浣犺嚜宸辯殑VIM甯姪
:helptags /vim/vim61/doc : 閲嶅緩 /doc 涓墍鏈夌殑 *.txt 甯姪鏂囦歡
:help add-local-help
----------------------------------------
# 鐢ㄥ閮ㄧ▼搴忔潵榪愯紼嬪簭 (渚嬪 perl :)
map <f2> :w<CR>:!perl -c %<CR>
# 璇戦噴錛?w<CR>鍐欐枃浠?br># :!perl -c %<CR>鐢╬erl鏉ヨ繍琛屽綋鍓嶆枃浠?br># 褰撳墠鏂囦歡蹇呴』鏈夋枃浠跺悕錛?br>----------------------------------------
# 鎻掑叆DOS鎹㈣絎?br>:%s/nubian/<C-V><C-M>&/g : Ctrl-V鏄竴縐嶈漿涔夛紝瀹冭瑕佽В閲?lt;C-M>
:%s/nubian/<C-Q><C-M>&/g : 瀵逛簬Win32搴旇榪欐牱
:%s/nubian/^M&/g : 浣犵湅鍒扮殑^M鏄竴涓瓧絎?br>:%s/nubian/\r&/g : 鏇村ソ鐨勫艦寮?br>----------------------------------------
# 鎶婃渶鍚庝竴涓懡浠よ創鍒板綋鍓嶄綅緗?br>i<c-r>:
# 鎶婃渶鍚庝竴涓悳绱㈡寚浠よ創鍒板綋鍓嶄綅緗?br>i<c-r>/
# 璇戦噴錛歩鏄繘鍏nsert妯″紡錛?br># Ctrl-r鏄紑鍚彃鍏ユā寮忎笅register鐨勫紩鐢?br># :鍜?鍒嗗埆寮曠敤浜嗕袱涓猺egister鐨勫唴瀹?br>----------------------------------------
# 鏇村鐨勫畬鎴愬姛鑳?br><C-X><C-F> :鎻掑叆褰撳墠鐩綍涓嬬殑涓涓枃浠跺悕鍒板綋鍓嶄綅緗?br># 鍦╥nsert妯″紡涓嬩嬌鐢?br># 鐒跺悗鐢?Ctrl-P/Ctrl-N 緲婚〉
----------------------------------------
# 鏇挎崲涓涓獀isual鍖哄煙
# 閫夋嫨涓涓尯鍩燂紝鐒跺悗杈撳叆 :s/Emacs/Vim/ 絳夌瓑錛寁im浼氳嚜鍔ㄨ繘鍏?妯″紡
:'<,'>s/Emacs/Vim/g : 鍓嶉潰鐨?<,'>鏄痸im鑷姩娣誨姞鐨?br>----------------------------------------
# 鍦ㄦ枃浠朵腑鎻掑叆琛屽彿(涓嶆槸鏄劇ず琛屽彿錛屾槸鎻掑叆錛?
:g/^/exec "s/^/".strpart(line(".")." ", 0, 4)
----------------------------------------
# 鐢╒IM鐨勬柟寮忔潵緙栧彿琛?br>:set number :鏄劇ず琛屽彿
:set nonu :鍙栨秷鏄劇ず
:%s/^/\=strpart(line('.')." ",0,&ts)
:'a,'b!perl -pne 'BEGIN{$a=223} substr($_,2,0)=$a++'
#浼間箮鏈夌偣灝忛棶棰橈紝浣犺瘯璇曠湅:)
#浼間箮涓嶈兘宸ヤ綔錛屼綘璇曡瘯鐪?)
----------------------------------------
# 楂樼駭閫掑 ("鐪熺殑寰堟湁鐢?錛宖t)
" 鎶婁笅闈㈠嚑鍙ユ斁鍒?_vimrc #vimrc鑴氭湰鐢?" 鍋氳娉ㄩ噴絎?br>let g:I=0
function! INC(increment)
let g:I =g:I + a:increment
return g:I
endfunction
" 渚嬪浠巑ark a 鍒癿ark b 閫掑錛屼粠223寮濮嬶紝姝ラ暱涓?
:let I=223
:'a,'bs/$/\=INC(5)/
" (鍘熸枃錛歝reate a map for INC)
" 浣嗘槸cab鏄竻妤氬懡浠よ緙╁啓鍟婏紵鎬庝箞鍥炰簨錛?br>cab viminc :let I=223 \| 'a,'bs/$/\=INC(5)/
----------------------------------------
# 鍔犲瘑(灝忓績浣跨敤錛屼笉瑕佸繕浜嗗瘑鐮?
:h :X
----------------------------------------
# modeline (make a file readonly etc) must be in first/last 5 lines
# 涓嶄細鐢紝涓嶇炕浜?br>// vim:noai:ts=2:sw=4:readonly:
:h modeline
----------------------------------------
# Creating your own GUI Toolbar entry
# 瀵逛簬text妯″紡涓嬬殑vim娌$敤錛屼笉緲諱簡
amenu Modeline.Insert\ a\ VIM\ modeline <Esc><Esc>ggOvim:ff=unix ts=4 ss=4<CR>v
----------------------------------------
# 涓涓繚瀛樺綋鍓嶅厜鏍囦笅鐨勭嫮涔夊瓧鍒頒竴涓枃浠剁殑鍑芥暟
function! SaveWord() "榪欓噷鐢?鏄己鍒惰鐩栦互鍓嶇殑瀹氫箟
normal yiw
exe ':!echo '.@0.' >> word.txt'
endfunction
map ,p :call SaveWord() #浣跨敤璇ュ嚱鏁扮殑涓涓緥瀛?br>----------------------------------------
# 鍒犻櫎閲嶅琛岀殑鍑芥暟
function! Del()
if getline(".") == getline(line(".") - 1)
norm dd
endif
endfunction
# 鍙屽瓧鑺傜紪鐮?(non alpha-numerics)
:digraphs : 鏄劇ず緙栫爜琛?br>:h dig : 甯姪
i<C-K>e' : 杈撳叆 é
i<C-V>233 : 杈撳叆 é (Unix)
i<C-Q>233 : 杈撳叆 é (Win32)
ga : 鏌ョ湅瀛楃鐨刪ex鍊?br>----------------------------------------
# 鏂囦歡鍚嶈嚜鍔ㄥ畬鎴?(渚嬪 main_c.c)
:e main_<tab> : tab 閿畬鎴?br>gf : 鎵撳紑鍏夋爣澶勫箍涔夊瓧鍛藉悕鐨勬枃浠?(normal妯″紡)
main_<C-X><C-F> : 鏂囦歡鍚嶈嚜鍔ㄥ畬鎴?insert妯″紡)
----------------------------------------
# Vim澶嶆潅浣跨敤
# 浜ゆ崲涓や釜鍗曡瘝
:%s/\<\(on\|off\)\>/\=strpart("offon", 3 * ("off" == submatch(0)), 3)/g
----------------------------------------
# 鎶妕ext鏂囦歡杞崲鎴恏tml鏂囦歡(oh,ft)
:runtime! syntax/2html.vim : 杞崲 txt 鎴?html
:h 2html : 鐪嬬湅甯姪
----------------------------------------
# VIM 鏈変竴涓唴閮ㄨ嚜甯︾殑 grep 鍛戒護
:grep some_keyword *.c : 寰楀埌涓涓寘鍚玸ome_keyword鐨刢鏂囦歡鍚嶅垪琛?br>:cn : 鍘諱笅涓涓嚭鐜扮殑浣嶇疆
----------------------------------------
# 寮哄埗鏃犲悗緙鏂囦歡鐨勮娉曠潃鑹叉柟寮?.pl
:set syntax=perl
# 鍙栨秷璇硶鐫鑹?br>:set syntax off
# 鏀瑰彉鑹插僵涓婚 (鍦▇vim/vim??/colors涓殑浠諱綍鏂囦歡)
:colorscheme blue
----------------------------------------
:set noma (non modifiable) : 闃叉淇敼
:set ro (Read Only) : 鍙淇濇姢
----------------------------------------
# Sessions (鎵撳紑涓緋誨垪鏂囦歡)
gvim file1.c file2.c lib/lib.h lib/lib2.h :鍦?session"涓姞杞戒竴緋誨垪鏂囦歡
:mksession : 鐢熸垚涓涓猄ession鏂囦歡 (榛樿鏄疭ession.vim)
:q
gvim -S Session.vim : 閲嶆柊璇誨彇涓涓猻ession錛屼篃灝辮鍙栦簡鎵鏈夋枃浠?ft
----------------------------------------
# 鏍囪(tags) (璺寵漿鍒皊ubroutines/functions)
taglist.vim : 鏈嫻佽鐨勬彃浠?br>:Tlist : 鏄劇ずTags (functions鐨勫垪琛?
<C-]> : 璺寵漿鍒板厜鏍囧鐨刦unction
: 榪欎釜閿?Ctrl-] 鍜寁im甯姪涓槸涓鏍風殑
----------------------------------------
# Just Another Vim Hacker JAVH
# Juat Another Perl Hacker JAPH錛屽樋鍢?br>vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"
# 璇戦噴錛氬懙鍛碉紝璋佹潵瑙i噴涓涓嬪惂錛?br># 鍏跺疄涓嶈繃鏄湪嬋媧籿im鐨勬椂鍊欐墽琛屼簡涓涓懡浠?br># 鍏堝啓鍏ヤ簡 Just Another Vim Hacker 鐨剅ot13緙栫爜
# 鐒跺悗鍐嶈瘧鐮?br>----------------------------------------
緇堜簬緲誨畬浜嗭紝鍛靛懙銆傚ソ绱晩錛?br>__END__
]]>
GVim v7錛堜富紼嬪簭錛?Ctags錛媡aglist+omnicppcomplete錛媠upertab(鎻掍歡)
涓錛屽畨瑁?br>錛?,omnicppcomplete 鐨勫畨瑁咃細
錛嶏紞1,涓嬭澆omnicppcomplete,瑙e帇鍙緱鍒頒笁涓枃浠跺す錛坅utoload,after,doc錛?鍒嗗埆澶嶅埗鍒癵vim鐨勫畨瑁呯洰褰曚笅鐨剉imfiles鏂囦歡澶逛腑(ubuntu涓負~/.vim)銆傝繖鏍穙mnicppcomplete灝卞畨瑁呭畬鎴愪簡銆?br>錛?,ctags 瀹夎
錛嶏紞1,涓嬭澆Ctags鏈鏂皐in32鐗堟湰錛堝綋鍓嶆槸5.6錛?瑙e帇鑷蟲煇涓鐩綍錛堝c:\ctags56錛?騫跺湪緋葷粺鐜鍙橀噺涓妸娣誨姞ctags鐨勫畨瑁呰礬寰勶紙濡俻ath=c:\ctags56錛夛紝鑷蟲ctags涔熷畨瑁呭畬鎴愪簡(ubuntu 涓洿鎺?sudo apt-get install ctags)銆?br>錛?,taglist 瀹夎
錛嶏紞1,涓嬭澆taglist鎻掍歡錛岃В鍘嬪緱鍒頒袱涓枃浠跺す錛坉oc錛宲lugin錛夛紝鎶婇噷闈㈢殑鏂囦歡鍒嗗埆澶嶅埗鍒皏im瀹夎鐩綍涓嬪搴旂殑鏂囦歡澶逛腑(ubuntu涓負~/.vim)銆?br>錛?,supertab鎻掍歡瀹夎
錛嶏紞1,涓嬭澆supertab鎻掍歡錛屽鍒秙upertab.vim鍒皏im瀹夎鐩綍鐨刾lugin鐩綍涓嬶紝浣跨敤鏃跺彧瑕佺洿鎺ユ寜tab閿紝灝卞彲浠ョ洿鎺ヨ繘琛岃ˉ鍏ㄣ?/font>
浜岋紝閰嶇疆
錛?,涓嬭澆鏈枃鐨勯檮浠訛紝瑙e帇鍙緱鍒頒袱涓枃浠訛紙stltags,cpptags;榪欎袱涓枃浠舵槸鏍規嵁mingw5.3鍜宑++ 鏍囧噯搴搒tl3.3鍒朵綔鐨勶級,澶嶅埗鍒版煇鐩綍(C:\ctags56\)錛岀劧鍚庡湪_vimrc(ubuntu涓嬩負~/.gvimrc鎴?usr/share/vim/gvimrc)涓坊鍔犱笅鍒椾唬鐮侊紝浣跨敤鏃剁敤TAB閿夋嫨鎻愮ず鐨勪唬鐮侊細
-----------------------------
"setting for omnicppcomplete
set nocp
filetype plugin on
"涓嬮潰鐨勮緗敤浜庡綋鐢ㄦ埛棰勫厛澹版槑namespace鏃朵篃鑳借嚜鍔ㄨˉ鍏ㄤ唬鐮侊紙濡備嬌鐢╱sing std::string錛?
let OmniCpp_DefaultNamespaces = ["std"]
" 璁劇疆浠g爜鎻愮ず紿楀彛鐨勯鑹詫紙榛樿涓虹矇綰㈣壊錛屽闄勫浘1,涓嬮潰鐨勮緗殑鏁堟灉濡傞檮鍥?錛?
highlight Pmenu ctermbg=13 guibg=LightGray
highlight PmenuSel ctermbg=7 guibg=DarkBlue guifg=White
highlight PmenuSbar ctermbg=7 guibg=DarkGray
highlight PmenuThumb guibg=Black
"璁劇疆tags鐩綍錛屽彲浠ユ牴鎹嚜宸辯殑璁劇疆鑷姩璋冩暣
set tags+=C:\ctags56\stltags
set tags+=C:\ctags56\cpptags
------------------------------
word_complete.vim
Insert妯″紡涓嬪湪杈撳叆鐨勬椂鍊欒嚜鍔ㄨˉ鍏ㄥ崟璇嶏紝濡傛灉琛ュ叏姝g‘鍙互鎸塗ab閿帴鍙楋紝鍚﹀垯鍙互涓嶇瀹冪戶緇緭鍏ユ垨鑰呮寜
Ctrl-n錛孋trl-p鍒囨崲琛ュ叏銆?娉ㄦ剰鏄緭鍏ヤ笁涓瓧絎﹀悗鎵嶅紑濮嬭ˉ鍏ㄣ?br>瀹夎錛?br>1. 鎷瘋礉鏂囦歡鍒癧浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\plugin\
2. 嬋媧昏ˉ鍏ㄦā寮?br>:call DoWordComplete()
3. 鍙栨秷琛ュ叏妯″紡
:call EndWordComplete()
4. 鑷姩鍔犺澆琛ュ叏妯″紡
鍦?vimrc鎴朹vimrc鏂囦歡涓姞鍏?br>:autocmd BufEnter * call DoWordComplete()
涓嬭澆錛?br>http://www.vim.org/scripts/script.php?script_id=73
c.vim
榪欎釜鎻掍歡瓚呭己錛屾彁渚涗簡寰堝渚夸簬C/C++緙栫▼鐨勫姛鑳斤紝姣斿鏂囦歡澶存ā鐗堬紝浠g爜鐗囨柇絳夈?br>灝卞儚甯姪鏂囨。鐨勫ご涓鍙ュ啓鐨勯偅鏍? C/C++IDE for vim/gvim.鍏蜂綋濡備綍鐨勫己澶у灝辯湅鐪嬪府鍔╁ソ浜?
瀹夎:
榪欎釜鐩稿鍦版瘮杈冪畝鍗?浣嗘槸鏂囦歡鍗存槸涓嶅皯:
1. 鎷瘋礉cvim.zip鍒癧浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles,
鎵цunzip,(娉ㄦ剰,濡傛灉鏄痺indow鐨剈nzip,璇烽夋嫨瑙e帇緙╁埌褰撳墠鐩綍)
2. 浣犲彲浠ヨ緗竴浜涗釜浜轟俊鎭湪.vimrc鎴朹vimrc涓?渚嬪:
let g:C_AuthorName = 'Moonz_wu'
let g:C_AuthorRef = 'Mn'
let g:C_Email = 'moonz.wu@gmail.com'
let g:C_Company = 'FSky co.'
3. 閲嶆柊鍚姩vim,騫舵墽琛屽懡浠?br>:help [浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\doc鏉ヤ駭鐢熷府鍔╂枃妗?
鍩烘湰涓婂畬鎴愯繖浜涙楠?榪欎釜cvim鎻掍歡灝卞彲浠ョ敤浜?涓嶈繃榪欓噷瑕佽鏄庣殑鏄В鍘嬪畬鍚?浣犱細鐪嬪埌涓や釜鍘嬬緝鏂囦歡
c-templates-comm.zip鍜宑-templates+comm.zip,榪欎袱涓尯鍒氨鏄痗-templates+comm.zip甯︽柟娉曟敞閲?
c-templates-comm.zip娌℃湁, 浣犲彲浠ヨВ鍘嬪叾涓竴涓?騫舵嫹璐濆埌.\plugin\templates.
浣犲彲浠ュ湪瑙e帇瀹岀殑doc涓壘鍒頒竴涓猦otkey.pdf鏂囦歡,閲岄潰璁蹭簡cvim瀹氫箟鐨勬墍鏈夊揩鎹烽敭.
crefvim.vim
涓篤IM瀹氬埗鐨凜鍙傝冩墜鍐岋紝榪欐牱瀵逛簬璇硶鎴栬呭嚱鏁頒笉娓呮鐨勫湴鏂瑰彲浠ユ柟渚跨殑鏌ユ壘浜?br>瀹夎錛?br>1.灝嗚剼鏈嫹璐濆埌浣犵殑鏈湴鐩綍涓紝
Unix: ~/.vim/plugin
windows: [浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\plugin
2. 灝嗗府鍔╂枃浠?鍗砫oc涓嬬殑鏂囦歡)鎷瘋礉鍒?br> Unix: ~/.vim/doc
Windows: [浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\doc
3.灝嗚娉曟枃浠?鍗硈yntax涓嬬殑鏂囦歡)鎷瘋礉鍒?br> Unix: ~/.vim/after/syntax
Windows: [浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\after\syntax
鐒跺悗鍚姩vim灝卞皢鑷姩鐨勫姞杞借剼鏈傜劧鍚庡湪vim鎵ц浠ヤ笅鍛戒護
Unix
:helptags ~/.vim/doc
windows
:helptags [浣犵殑gvim鐨勫畨瑁呯洰褰昡\vimfiles\doc
鍛靛懙錛岄偅涔堟悶瀹氬悗浣犲湪vim涓啓鍏ヤ竴涓猘toi(),榪愯鍛戒護\cr錛岀湅鐪嬫晥鏋溿?br>榪欎釜鏄痗refvim甯姪閲岀殑(<Leader> = \)
<Leader>cr normal mode: get help for word under cursor
Memory aid cr: (c)-(r)eference
<Leader>cr visual mode: get help for visually selected text
Memory aid cr: (c)-(r)eference
<Leader>cw: prompt for word CRefVim should search for
Memory aid cw: (c)-reference (w)hat
<Leader>cc: jump to table of contents of the C-reference manual
Memory aid cc: (c)-reference (c)ontents
鍏蜂綋榪橀渶鐪嬬湅甯姪銆?br>涓嬭澆:
http://www.vim.org/scripts/script.php?script_id=614
榪欓噷鏈変竴綃囧緢濂界殑璁瞯im鎻掍歡鐨勬枃绔?鎴戜篃鍊熼壌浜嗕竴閮ㄤ喚^_^!
http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/877033_5.html
VIM script鍖呭惈鍑犲ぇ綾?
銆銆VIM鐨剆cript瀹夎闈炲父綆鍗曪紝涓嬭澆鐨剆cript鏂囦歡鎴栬呭帇緙╁寘閲屽ご閮芥湁瀹夎璇存槑錛屽湪VIM鐨勫畨瑁呯洰褰曪紙姣斿C:\VIM64錛変笅闈㈡湁涓涓獀imfiles鐩綍錛屾妸script鏀懼埌vimfiles鐩綍涓嬪嵆鍙傚浜庡鐢ㄦ埛緋葷粺錛屽彲浠ュ湪HOME鐩綍錛堜竴鑸槸c:\Documents and Settings\ <USER_NAME>\錛変笅闈㈠緩绔嬩竴涓獀imfiles鐩綍錛屾妸script鏀劇疆鍒拌繖閲屻?/p>
銆銆涓嬮潰鏄竴浜涘ソ鐢ㄧ殑VIM鎻掍歡錛屽叿浣撲嬌鐢ㄥ姙娉曡鍙傝冨悇鑷倂im鏂囦歡澶撮儴鐨勬敞閲娿?/p>
銆銆BufExplorer.vim *****
銆銆http://www.vim.org/scripts/script.php?script_id=42
銆銆榪欎釜鎻掍歡鍙互浣跨紪杈戝鏂囦歡鏇村姞鏂逛究錛岃瀹屾彃浠跺悗Normal mode涓嬭緭鍏be鍗沖彲鎵撳紑緙撳啿鍖哄垪琛紝鍏夋爣鏀劇疆鍦ㄦ煇涓涓枃浠朵笂鎸夊洖杞﹀嵆鍙墦寮榪欎釜鏂囦歡錛岃岀紦鍐插尯鍒楄〃鑷姩鍏抽棴銆?/p>
銆銆Taglist.vim *****
銆銆http://www.vim.org/scripts/script.php?script_id=273
銆銆榪欎釜鎻掍歡鍙互瀹炵幇綾繪垨鑰呭嚱鏁板垪琛ㄥ姛鑳斤紝鏀寔C/C++錛宩ava錛宲erl錛宲ython錛宼cl錛宻ql錛宲hp絳夎璦錛屽畠鍙互鍦╒IM涓垱寤轟竴涓獥鍙o紝鍒楀嚭緙栬緫鐨勬簮鏂囦歡涓殑綾匯佸嚱鏁般佸彉閲忓畾涔夊垪琛紝鑰屼笖鏇存柟渚跨殑鏄繖涓垪琛ㄤ篃鎻掑叆鍦ㄤ簡鍙抽敭鑿滃崟涓紝鍒嗙被瀛樻斁錛岃闂潪甯告柟渚褲?/p>
銆銆TabBar.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=1338
銆銆榪欎釜鎻掍歡瀹炵幇浜嗙被浼糢ltraEdit涓殑鏍囩欏電殑鍔熻兘錛岃屼笖鑳介氳繃Alt-<n>鏉ュ垏鎹紝<n>浠h〃1-9銆?/p>
銆銆minibufexpl.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=159
銆銆瀹炵幇浜嗙被浼糢ltraEdit涓殑鏍囩涔熷姛鑳姐?/p>
銆銆c.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=213
銆銆鎻愪緵浜嗗緢澶氫究浜嶤/C++緙栫▼鐨勫姛鑳斤紝姣斿鏂囦歡澶存ā鐗堬紝浠g爜鐗囨柇絳夈?/p>
銆銆CRefVim **
銆銆http://www.vim.org/scripts/script.php?script_id=614
銆銆涓篤IM瀹氬埗鐨凜鍙傝冩墜鍐岋紝榪欐牱瀵逛簬璇硶鎴栬呭嚱鏁頒笉娓呮鐨勫湴鏂瑰彲浠ユ柟渚跨殑鏌ユ壘浜嗐?/p>
銆銆latex-suite *****
銆銆http://www.vim.org/scripts/script.php?script_id=475
銆銆http://vim-latex.sf.net/
銆銆鎻愪緵浜嗗緢澶氫究浜庣紪杈慣eX/LaTeX鏂囦歡鐨勫姛鑳斤紝姣斿鍦╒IM閲岄潰緙栬瘧鎴栬呴瑙堛佽嚜鍔ㄦ彃鍏eX鏍囪絳夈?/p>
銆銆word_complete.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=73
銆銆Insert妯″紡涓嬪湪杈撳叆鐨勬椂鍊欒嚜鍔ㄨˉ鍏ㄥ崟璇嶏紝濡傛灉琛ュ叏姝g‘鍙互鎸塗ab閿帴鍙楋紝鍚﹀垯鍙互涓嶇瀹冪戶緇緭鍏ユ垨鑰呮寜Ctrl-n錛孋trl-p鍒囨崲琛ュ叏銆?娉ㄦ剰鏄緭鍏ヤ笁涓瓧絎﹀悗鎵嶅紑濮嬭ˉ鍏ㄣ?/p>
銆銆Vim JDE
銆銆http://www.vim.org/scripts/script.php?script_id=1213
銆銆鏀寔C/C++絳夌殑鑷姩瀹屾垚錛堥渶瑕乂IM 7.0錛岀紪璇戞椂鎵撳紑+ruby鐗規э級錛?/p>
銆銆cppcomplete.vim **
銆銆http://www.vim.org/scripts/script.php?script_id=527
銆銆鑳借嚜鍔ㄥ畬鎴怌/C++/Java鐨勭粨鏋勬垨綾繪垚鍛橈紝娉ㄦ剰瀹冪殑蹇嵎閿槸Alt-l錛堝瓧姣峀錛変笉鏄疉lt-i銆?/p>
銆銆The NEAD Commenter **
銆銆http://www.vim.org/scripts/script.php?script_id=1218
銆銆鍦ㄨ澶氱被鍨嬬殑鏂囦歡涓柟渚跨殑鍔犱笂娉ㄩ噴鎴栬呭彇娑堟敞閲娿?/p>
銆銆winmanager
銆銆http://www.vim.org/scripts/script.php?script_id=95
銆銆鎶婃爣鍑嗙殑File Explorer浠ュ強Buffer Explorer鎻掍歡闆嗘垚鍦ㄤ竴璧鳳紝鎻愪緵鐜頒唬緙栬緫鍣ㄤ腑甯歌鐨勬枃浠跺垪琛ㄥ拰緙撳啿鍖哄垪琛ㄥ姛鑳姐?/p>
銆銆sketch.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=705
銆銆Draw with mouse: boxes, arrows, lines, fills. Transparent/opaque drag and drop.鐓х潃瀹冪殑鏁欑▼鍋氫竴閬嶏紝浣犲氨浼氶渿鎾間簬瀹冪殑鍒涙剰浜嗐?/p>
銆銆DrawIt.vim **
銆銆http://www.vim.org/scripts/script.php?script_id=40
銆銆鍙互鏂逛究鐨勭敾榪炵嚎鍥俱?/p>
銆銆MultipleSearch ***
銆銆http://www.vim.org/scripts/script.php?script_id=479
銆銆MultipleSearch2.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=1183
銆銆Mark.vim ***
銆銆http://www.vim.org/scripts/script.php?script_id=1238
銆銆otf.vim **
銆銆http://www.vim.org/scripts/script.php?script_id=634
銆銆榪欎簺鎻掍歡鍙互鍚屾椂楂樹寒鏄劇ず澶氭鎼滅儲緇撴灉錛岃繖涓壒鎬ч潪甯告湁鍒╀簬鏄劇ず浠g爜涓煇浜涘彉閲忔垨鍑芥暟鐨勮皟鐢ㄤ綅緗?/p>
銆銆SearchComplete.vim *
銆銆http://www.vim.org/scripts/script.php?script_id=474
銆銆鍙互鐢?鎼滅儲鏃舵寜Tab琛ュ叏瑕佹悳绱㈢殑鍗曡瘝銆?/p>
銆銆Vim Intellisense
銆銆http://insenvim.sourceforge.net
銆銆欏懼悕鎬濅箟錛屾鎻掍歡鐢ㄤ簬緇橵IM鎻愪緵鏅鴻兘瀹屾垚鍔熻兘錛屾敮鎸丆++錛孋#錛孞ava錛孞SP錛孒TML錛孲QL錛孹ML錛岀瑪鑰呭畨瑁呭悗涓鐩存噿寰楅厤緗紝涔熷氨娌$敤涓娿?/p>
銆銆project
銆銆http://www.vim.org/scripts/script.php?script_id=69
銆銆鎻愪緵涓浜汭DE鍔熻兘錛岀湅浠嬬粛浼間箮寰堜笉閿欍?/p>
銆銆JavaBrower
銆銆http://www.vim.org/scripts/script.php?script_id=588
銆銆鎻愪緵鏂囦歡涓璊ava綾葷殑鏍戠姸鍒楄〃銆?/p>
銆銆vimspell
銆銆http://www.vim.org/scripts/script.php?script_id=465
銆銆ispell or aspell based spell checker with fly-spelling銆?/p>
銆銆cream
銆銆http://cream.sourceforge.net/
銆銆涓濂楅厤緗枃浠訛紝鍙互鎶奦IM鐨勭晫闈㈡敼鎴怌UA錛圕ommon User Access錛夋ā鍨嬶紝闄嶄綆VIM鐨勫涔犻毦搴︼紝涓漢涓嶆帹鑽愯繖縐嶅仛娉曪紝涓嶈繃鍏朵腑鏈変簺楂樼駭閰嶇疆鍊煎緱瀛︿範錛堟湁鎰忔濈殑鏄疎macs涔熸湁綾諱技鐨勯」鐩? Easymacs錛孍macsW32錛夈?/p>
銆銆IComplete
銆銆http://icomplete.sf.net
銆銆鎼厤VIM 7.0鐨凮mni Complete錛屽彲浠ュ仛鍒癈/C++鐨勬櫤鑳藉畬鎴愬姛鑳?
The motion commands can be used after an operator command, to have the command
operate on the text that was moved over. That is the text between the cursor
position before and after the motion. Operators are generally used to delete
or change text. The following operators are available:
|c| c change
|d| d delete
|y| y yank into register (does not change the text)
|~| ~ swap case (only if 'tildeop' is set)
|g~| g~ swap case
|gu| gu make lowercase
|gU| gU make uppercase
|!| ! filter through an external program
|=| = filter through 'equalprg' or C-indenting if empty
|gq| gq text formatting
|g?| g? ROT13 encoding
|>| > shift right
|<| < shift left
|zf| zf define a fold
|g@| g@ call function set with the 'operatorfunc' option
鍦ㄥ嚱鏁頒腑縐誨姩鍏夋爣
[[ 杞埌涓婁竴涓綅浜庣涓鍒楃殑“{”
]] 杞埌涓嬩竴涓綅浜庣涓鍒楃殑“{”
{ 杞埌涓婁竴涓┖琛?br> } 杞埌涓嬩竴涓┖琛?br> gd 杞埌褰撳墠鍏夋爣鎵鎸囩殑灞閮ㄥ彉閲忕殑瀹氫箟
* 杞埌褰撳墠鍏夋爣鎵鎸囩殑鍗曡瘝涓嬩竴嬈″嚭鐜扮殑鍦版柟
# 杞埌褰撳墠鍏夋爣鎵鎸囩殑鍗曡瘝涓婁竴嬈″嚭鐜扮殑鍦版柟
鎷彿鐨勫尮閰?br> % 鐢ㄦ潵榪涜灝忔嫭鍙楓佷腑鎷彿鍜屽ぇ鎷彿鐨勫尮閰?br>
taglist甯姪鏂囦歡
<CR> 璺沖埌鍏夋爣涓媡ag鎵瀹氫箟鐨勪綅緗紝鐢ㄩ紶鏍囧弻鍑繪tag鍔熻兘涔熶竴鏍?br>o 鍦ㄤ竴涓柊鎵撳紑鐨勭獥鍙d腑鏄劇ず鍏夋爣涓媡ag
<Space> 鏄劇ず鍏夋爣涓媡ag鐨勫師鍨嬪畾涔?br>u 鏇存柊taglist紿楀彛涓殑tag
s 鏇存敼鎺掑簭鏂瑰紡錛屽湪鎸夊悕瀛楁帓搴忓拰鎸夊嚭鐜伴『搴忔帓搴忛棿鍒囨崲
x taglist紿楀彛鏀懼ぇ鍜岀緝灝忥紝鏂逛究鏌ョ湅杈冮暱鐨則ag
+ 鎵撳紑涓涓姌鍙狅紝鍚寊o
- 灝唗ag鎶樺彔璧鋒潵錛屽悓zc
* 鎵撳紑鎵鏈夌殑鎶樺彔錛屽悓zR
= 灝嗘墍鏈塼ag鎶樺彔璧鋒潵錛屽悓zM
[[ 璺沖埌鍓嶄竴涓枃浠?br>]] 璺沖埌鍚庝竴涓枃浠?br>q 鍏抽棴taglist紿楀彛
<F1> 鏄劇ず甯姪
""""""""""""""""""""""""""""""
" Tag list (ctags)
""""""""""""""""""""""""""""""
if MySys() == "windows" "璁懼畾windows緋葷粺涓璫tags紼嬪簭鐨勪綅緗?/span>
let Tlist_Ctags_Cmd = 'ctags'
elseif MySys() == "linux" "璁懼畾windows緋葷粺涓璫tags紼嬪簭鐨勪綅緗?/span>
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
endif
let Tlist_Show_One_File = 1 "涓嶅悓鏃舵樉紺哄涓枃浠剁殑tag錛屽彧鏄劇ず褰撳墠鏂囦歡鐨?/span>
let Tlist_Exit_OnlyWindow = 1 "濡傛灉taglist紿楀彛鏄渶鍚庝竴涓獥鍙o紝鍒欓鍑簐im
let Tlist_Use_Right_Window = 1 "鍦ㄥ彸渚х獥鍙d腑鏄劇ずtaglist紿?/span>