01_vi use

  1. 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
  2. Input mode to command mode: esc
  3. Line mode to command mode: esc

Some commands in command mode:

  1. 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
  2. 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
  3. copy:
    • yy: Copy the current line
    • 3yy: Copy the three lines
  4. Paste:
    • p: Paste to the next line
    • 2p: Paste 2 was repeated once, the number of times (NP)
    • P: Paste on line
  5. replace:
    • r: single character replacement
    • r: single character replacement
  6. Undo: u
  7. Recovery: ctrl + r # sublime is ctrl + y
  8. Find:
    / hello: hello look down, look forward lookup by n, N reverse lookup
    hello:? Hello look up,
  9. Block operations: v / V

Guess you like

Origin www.cnblogs.com/nichengshishaonian/p/11525317.html