0 indicates the beginning of a line, and $ indicates the end
G moves to the end of the line, Ng moves to n rows, GG moves to the beginning
[ENTER] jumps to the next line of the current cursor
/word down looking for word this word
Word looks up word this word
N repeats the previous find operation
N reverse, repeat previous find operation up
: N1,n2s/word1/word2/g replaces word1 with N1 line to N2 between rows Word2
: N1,N2S/WORD1/WORD2/GC provides a choice of whether to replace each match or skip it, etc.
: 1, $s/word1/word2/g replace from first line to last line
X,x Delete a character from the current row
Nx
DD Delete When moving forward
Ndd
D1G Delete all rows up
DG drops all rows down
D0 character that deletes the position of the current line at the beginning of the cursor
d$ Delete the position of the current line cursor to the end of the line character
YY copy when moving forward
Nyy
y1g
YG
Y0
y$
P,p paste on the next line or row of the cursor
In general mode, press V to become the visual mode, you can copy and paste the selected block
: W
: w!
: Q
: q! Forced rollout does not save
: Wq
If ZZ changes, save and leave, or go straight away.
: w [filename] Save As
: R [FileName] adds additional file reading to the line following the cursor
: N1,n2 W[filename] N1 to N2 content Save As
:! command to jump out of some instructions
: Set Nu
: Set Nonu
VIM Common directives