vi and vim of common commands
The relationship between the three modes of vi and vim
-
Normal mode: you can use some shortcuts, but you can not edit the contents.
-
Insert mode: Can be written content.
-
Command line mode: can some commands to manipulate files.
Under normal circumstances, enter the file, the default normal mode
Three modes of conversion method
-
Normal mode ------> Insert Mode: Press i, O (or other keys to enter, can be generally used directly i).
-
Insert Mode ------> Normal Mode: Press ESC.
-
Normal Mode ------> Command Line Mode: Press the text input colon (:) or (/).
-
------ 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