I read some documents and summarized some basic Vim commands suitable for programmers. they are not very complete, but at least practical... All are the most basic vim tutorials. open the terminal under fedora. Input vimfilename to enter the vim // basic file. ..
I read some documents and summarized some basic Vim commands suitable for programmers. they are not very complete, but at least practical... Are the most basic
Vim tutorial
Open the terminal under fedora.
Input vim filename to enter vim
///////////////////////////////
Basic file operations
W: Save
Wq: Save and exit
Q! : Do not save and exit
///////////////////////////////
Delete Command
In command mode, enter
Dw press enter to delete the cursor position character
D is to delete all characters in the row (this is useful for writing programs)
Dd deletes a row.
U undo operation www.2cto.com
//////////////////////////////
Search command
/String here is the string you want to search.
N jumps to the next target of the current search target.
+ N search back.
//////////////////////////////
Bracket matching command
Place the cursor under the brackets and enter
% Will automatically jump the cursor to the matching brackets, which is useful for writing programs.
//////////////////////////////
Copy and select
GgyG: all copies
DG: delete the content after the cursor (move the cursor to the beginning to delete all content)
P: Mark the content of the paste cache area.
Yy: copy the current row
Nyy: copy the content of n rows down where the cursor is located.
//////////////////////////////
Cursor movement command
0: move to the front of the row where the cursor is located
$: Move to the end of the row where the cursor is located
H: move the first column of the first row of the current screen
M: move the first column of the middle row of the current screen
L: move the first column of the last row of the current screen
NG: Move to row n
N-: Move n rows up
N +: Move n rows down
G: move to the beginning of the last row
From firefoxbug's column