VIThere are 3 modes of the editor:Command mode,Input Mode,last-line mode. It is important to master these three models:
Command mode: VI starts after the default entry is the command mode, from this mode use the command can switch to the other two modes, while in any mode just click [ESC]Key to return to the command mode.
Input mode: Enter subtitles in command mode"I"You can edit the file into the input mode of VI. In this mode we can edit, modify, input and other editing work, in the last line of the editor to display a "--insert--" Mark VI entered the input mode. We need to save the file when we have finished modifying the input, then we need to return to the command mode and save it in the last line mode.
Last-line mode: Input in command mode":"to enter this mode, there are many useful commands in the last line mode.
Two, copy
a , copy the entire row
Command mode, the cursor is in the current row to be copied, enter yy
b , copy a word
Command mode, the cursor is in the first letter of the current word to be copied, enter yw
Three, paste
Command mode, enter P
Four, delete
a , delete the entire row
Command mode, the cursor is in the row you want to delete, enter DD
b , delete a word
Command mode, the cursor is in the first letter of the word to be deleted, enter DW
Five, Undo
Command mode, enter u
Six, Jump
Command mode,Enter the number of rows to jump, and then enter GG
such as: to jump to the 150th line of the current file, enter 150gg
This article from "Clay Turtle" blog, declined reprint!
VI edit mode