1. Install Vim
#vim +n filename # #n是数字, you can navigate to the nth row of the file
2. Shortcut keys
In the general mode:
J down K up H left L right
The number 0 or shift+6 moves to the beginning of the bank
Shift+4 move to the end of bank line
GG move to first line g move to Tail line
NG (n is any number) moves the nth row
In edit mode:
I enter edit mode
Command mode:
/word? Word looks for a string after/before the cursor
: n1,n2s/word1/word2/g find word1 between n1,n2 rows and replace with Word2, and no G replaces only the first word1 of each row
: 1, $s/word1/word2/g replace all word1 in the document with Word2, no G replaces only the first word1 of each row
: Set NU Displays line number: Set Nonu does not display line numbers
This article is from the "Rhythm" blog, make sure to keep this source http://rhythm.blog.51cto.com/2800158/1629239
2015.3.25 Vim Editor