Vim working mode (diagram)
650) this.width=650; "title=" 1.png "alt=" 1.png "src=" http://ask.apelearn.com/uploads/questions/20161121/ Af81c577bb73dc91582301c824210ebb.png "/>
Vim three modes: Command mode, input mode, last line mode
Command line mode: Control cursor movement, can delete, copy, paste and so on text
Input mode: In general mode can be deleted, copied, pasted and so on, but cannot edit the contents of the file
Last-line mode: In this mode, you can provide the action of your search data.
In the last line mode:
: Q #退出
: q! #强制退出, discard the modifications made
: Wq #保存退出
: x #保存退出
Command mode
ZZ: Save Exit
ZQ: Do not save exit
Command mode cursor jump
1. Jump between characters
H: Left L: Right J: down K: Upper
2. Jump between words
W: The beginning of the next word e: The ending of the current or next word
B: The first word of the current or previous word
3. Beginning line End Jump
^: jumps to the first non-whitespace character at the beginning of a line
0: Jump to the beginning of the line
$: Jump to end of line
3. Move between rows:
G: Last line
1G,GG: First line
Replace command (R,replace)
R: the character at which the cursor is replaced
Delete command:
D: Delete command, can be used in conjunction with the cursor Jump command, to achieve range deletion
For example: DW Deletes a word, DG deletes the current cursor line to the last row
d$: Delete to end of line
D0: Delete to the beginning of the line
DD: Delete the line where the cursor is located
#dd: Multi-line deletion
Copy command
Y: Copy yy: Copy entire row
Paste command (p,paste)
Flip Screen operation
CTRL+F: Flip a screen to the end of the file
CTRL+B: Flip a screen to the file header
Ctrl+d: Turn half screen at the end of the file
Ctrl+u: Turn half screen to file header
Use of the VIM editor