1. Type 0 (zero) to move to the start of the line.
Type 2w to move the cursor two words forward.
Type 3e to move the cursor to the end of the third word forward.
2. Type x to delete the first unwanted character.
Type rx to replace the character at the cursor with x
3. To change until the end of a word, type ce (ce + 淇鐨勫崟璇?
4. C灝辯被浼間簬d銆俤e,dw,d$閮藉搴旂潃ce,cw,c$
5. Type CTRL-G to show your location in the file and the file status.
Type G to move to a line in the file.
6. Press G to move you to the bottom of the file.
Type gg to move you to the start of the file.
7. Type / followed by a phrase to search for the phrase.
8. To search for the same phrase again, simply type n .
To search for the same phrase in the opposite direction, type N
9. To search for a phrase in the backward direction, use ? instead of /
10. To go back to where you came from press CTRL-O
11. 鍖歸厤浣跨敤%錛屾斁緗湪涓涓嫭鍙蜂笅闈紝鐒跺悗杈撳叆%錛屽氨浼氳煩杞埌鍙﹀涓涓笂闈€?nbsp;
12. type :#,#s/old/new/g where #,# are the line numbers of the range
of lines where the substitution is to be done. 錛堜袱琛屼箣闂寸殑鎵鏈夋枃鏈級
Type :%s/old/new/g to change every occurrence in the whole file.錛堜笉鎻愮ず錛屼絾鏄槸鏁翠釜鏂囦歡錛?br /> Type :%s/old/new/gc to find every occurrence in the whole file,
with a prompt whether to substitute or not.錛堟彁紺烘槸鍚︿唬鏇匡級
13.g琛ㄧず鍙栦唬璇ヨ鎵鏈夌殑銆?br /> 姣斿:s/thee/the/g琛ㄧず鍙栦唬璇ヨ涓墍鏈夌殑thee涓簍he銆?nbsp;
14. CTRL-G displays your location in the file and the file status.
G moves to the end of the file.
number G moves to that line number.
gg moves to the first line.
15. 錛氾紒 榪愯鎵ц澶栭儴紼嬪簭銆傦紙鍐掑彿鏄繀欏葷殑錛屽懡浠ゆā寮忛兘蹇呴』鐨勶紝姣斿錛歸琛ㄧず淇濆瓨錛?(澶栭儴鍛戒護濡俵s錛宲wd闇瑕佷嬌鐢紒錛岃屽唴閮ㄥ懡浠ゅ垯鏄洿鎺ワ細w絳夌瓑錛屼笉闇瑕佷嬌鐢紒)
16. 杈撳叆v榪涘叆瑙嗚妯″紡錛屾鏃墮紶鏍囧悜涓嬩細閫変腑閮ㄥ垎鏂囧瓧錛岀劧鍚庡彲浠ュ閫変腑鐨勬枃瀛楁搷浣溿?br />姣斿錛歸 TEST鍒欎細鎶婇変腑鐨勪繚瀛樹綅鏂囨湰銆?br />:d鍒欎細鍒犻櫎閫変腑鐨勬枃鏈?nbsp;
17. 鎻掑叆涓涓枃浠剁殑閮ㄥ垎鍐呭錛屼嬌鐢細r FILENAME鍗沖彲鎻掑叆涓涓枃浠跺埌璇ヨ銆?nbsp;
18. 鍦ㄤ笅鏂規柊寤轟竴涓┖琛岋紝浣跨敤o錛?br /> 鍦ㄤ笂鏂規柊寤轟竴涓┖琛岋紝浣跨敤O銆傦紙鍛戒護妯″紡涓嬶級 錛堣緭鍏ュ懡浠ゅ悗浼氳繘鍏ユ彃鍏ユā寮忥級
NOTE: a, i and A all go to the same Insert mode, the only difference is where
the characters are inserted.錛坅鏄湪鍏夋爣鍚庯紝A鏄湪琛屾湯灝撅紝i鍒欐槸鍏夋爣澶勶級
19. e璺寵漿涓涓崟璇嶃俥.g: 2e琛ㄧず璺寵漿涓や釜鍗曡瘝錛屾瘮鍚戝彸閿洿蹇嵎銆?br /> G璺寵漿琛屻俥.g: 721G琛ㄧず璺寵漿鍒扮721琛?br />
20. 鏇挎崲錛?br />R錛氭浛鎹綅澶氫釜瀛楁瘝
r錛氭浛鎹綅鍗曚釜瀛楁瘝
21. Move the cursor to the end of the next line: j$
22. Use the y operator to copy text and p to paste it
NOTE: you can also use y as an operator; yw yanks one word.
23. Set the 'ic' (Ignore case) option by entering: :set ic錛堝寘鍚ぇ灝忓啓鍖歸厤鐨勯兘鏄劇ず鍑烘潵錛屾瘮濡侷gnore錛孖GNORE錛?br /> Set the 'hlsearch' and 'incsearch' options: :set hls is錛堥珮浜樉紺猴級
錛坰et option錛?br />24. Typing ":set xxx" sets the option "xxx". Some options are:
'ic' 'ignorecase' ignore upper/lower case when searching
'is' 'incsearch' show partial matches for a search phrase
'hls' 'hlsearch' highlight all matching phrases
You can either use the long or the short option name.
25. Prepend "no" to switch an option off: :set noic
26. 鍦ㄥ懡浠ゆā寮忎笅錛岃緭鍏鐒跺悗鎸塗AB閿紝浼氳嚜鍔ㄥ嚭鐜板緢澶氱浉鍏崇殑鍛戒護錛堜互e寮澶寸殑鍛戒護錛夈傦紙絎竴涓浉鍏崇殑錛?br />鎸塁trl + D鑳藉鍑虹幇鎵鏈変互浠栧紑澶寸殑鍛戒護銆?nbsp;

]]>