- Enter command mode to input mode:
I: the front I: first line
a: rear A: end of line
o: next line O: On line
s: delete the current character and insert mode S: delete the entire line, and the input mode - Input mode to command mode: esc
- Line mode to command mode: esc
Some commands in command mode:
- mobile:
- h Left
- j under
- The k
- l Right
- gg: to the first line (first row)
- 1G: move to the first row (first row)
- nG: the first few lines, n is the number
- G: move to the end of line
- delete:
- ciw delete a word and insert mode
- yiw copy a word
- diw delete a word
- dd: delete a row, shear line
- ndd: Delete n lines, n is a number (1, 2, 3 ...)
- dG: Delete from current line to the last line
- d1G: Deletes the current line to the first line
- dw: Delete the current location to the end of the word
- d ^: Delete from current character to the beginning of the line
- d $: Delete from current character to the end of the line
- x: Delete current character
- 3x: delete three characters
- s: delete the current character and enter input mode
- S: delete the entire line, and the input mode
- cw: delete the current position to the end of the word and enter insert mode
- copy:
- yy: Copy the current line
- 3yy: Copy the three lines
- Paste:
- p: Paste to the next line
- 2p: Paste 2 was repeated once, the number of times (NP)
- P: Paste on line
- replace:
- r: single character replacement
- r: single character replacement
- Undo: u
- Recovery: ctrl + r # sublime is ctrl + y
- Find:
/ hello: hello look down, look forward lookup by n, N reverse lookup
hello:? Hello look up, - Block operations: v / V