vi and vim editor study notes

vi and vim of common commands

The relationship between the three modes of vi and vim

  1. Normal mode: you can use some shortcuts, but you can not edit the contents.

  2. Insert mode: Can be written content.

  3. Command line mode: can some commands to manipulate files.

    Under normal circumstances, enter the file, the default normal mode

Three modes of conversion method

  1. Normal mode ------> Insert Mode: Press i, O (or other keys to enter, can be generally used directly i).

  2. Insert Mode ------> Normal Mode: Press ESC.

  3. Normal Mode ------> Command Line Mode: Press the text input colon (:) or (/).

  4. ------ command line mode> Normal mode: press the ESC key.

    Three modes in the normal mode to the relay station

Common control commands

Normal mode:
1. Delegate yy Copy current line, press p to paste.
2. dd behalf delete the current line.
3. u representatives revoked.
4. G represents the jump to the last line, represents the most gg jump to the first line.

Command line mode:
1.: the SET NU represents the current contents of the file compiled line number.
2.: set nonu to cancel the line number.
3. / Keyword Find your keywords have a place in the document, press n to jump to the next place where there is the keyword.

跳到指定行:先再命令行模式对内容进行编号,再在正常模式下输入行数
(此时不会显示),再在该模式下按shift + g
Released nine original articles · won praise 0 · Views 1006

Guess you like

Origin blog.csdn.net/qq_43156103/article/details/88212972