VI Vim
Linux has multiple editors, but different distribution, VI is basically supported on every distribution.
Vim is an enhanced version of VI. Vim has the ability to edit the program, can be active in font color to identify the correctness of the grammar, convenient programming.
Three Modes of VI:
Three modes of the VIM Editor: normal mode, edit mode, and command line mode.
You can delete, copy, and paste in general mode, but you cannot edit the contents of the file more explicitly.
Switch from general mode to edit mode to press I, I, O, O, A, a, R, R keys. As described below, the individual feel that only need to remember I can be.
- I,i: Enter insert mode,I is inserted from the current cursor location . I begin the insertion at the first non-whitespace character at the current row.
- A,a: Enter insert mode. A is the insertion starting at the next character where the cursor is currently located. A is inserted starting at the last character of the row.
- O,o: Enter insert mode. O is inserted on the next line. O is inserted on the previous line.
- R,r: Enter replacement mode. R replaces only the same character as the cursor. R will always replace the character of the cursor until the ESC key is pressed.
Switch from edit mode to Austrian General mode: ESC.
In the general mode, enter:,/,? Any of the three can move the cursor to the bottom line, that is, command mode, in this mode can provide the operation to find data, read, save, a large number of substitution characters, leaving VII, display line number and other operations are done in this mode.
There is no way to switch between edit mode and command-line mode.
In general mode, the commands you can execute are:
command to move the cursor:
- PgDn Key: Next page (This command is also valid in edit mode)
- PgUp Key: Previous page (This command is also valid in edit mode)
- Home key: The cursor moves to the front of the first character of the line (this command also works in edit mode)
- End key: The cursor moves to the back of the last character in the line (this command also works in edit mode)
- G: Cursor moves to the last line
- 1G or GG: Move the cursor to the first line
- 10G: Cursor moves to line 10th
- Enter 10 and press ENTER: The cursor moves down 10 lines.
VI and VIM