All Linux systems will be built in vi text compiler
vim has the ability of program editing, is an enhanced version of vi, can take the initiative to distinguish the correctness of grammar with font color, convenient programming. The programming functions of code completion, compilation and error jump are particularly rich.
vi three modes
command line mode
insert mode
insert mode
bottom line mode
command line mode: when users edit files with vi, they initially enter the general mode. In this mode the user can move up and down through the cursor on the “delete” or “the whole line operations” and other operations, also can undertake “copy”, “paste”, such as operation, but cannot edit text
insert mode: text edit users to input, the user can press the ESC key to return to the command line mode
the bottom line: the cursor is located in the bottom of the screen, the user can save to file, or exit the operation, also can set the editing environment, such as looking for a string, line Numbers listed
common command line mode function keys
function keys th> | function th> tr> | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
I td> | switch to the insert mode, in front of the current cursor insert input text td> tr> | |||||||||||||||||||||||||||||||||
a td> | switch line mode, Behind the current cursor insert input text td> tr> | |||||||||||||||||||||||||||||||||
o td> | what line mode switch td> tr> | |||||||||||||||||||||||||||||||||
Ctrl + b td> | screen back to turn over a page td> tr> | |||||||||||||||||||||||||||||||||
Ctrl + f td> | screen forward one page td> tr> | |||||||||||||||||||||||||||||||||
Ctrl + u td> | screen turn back half a page td> tr> | |||||||||||||||||||||||||||||||||
td> 0 (zero) array td>
| cursor to the beginning of the bank td> tr>
| G td>
| cursor to the end of the file td> tr>
| nG td>
| cursor to the first n rows td> tr>
| $ td>
| moved to the end of each line cursor line td> tr>
| n td>
| cursor moves down n td> tr>
| /name td>
| after the cursor a called name string td> tr>
| ?The name td>
| before the cursor a called name string td> tr>
| x td>
| delete the location of the cursor one character td> tr>
| x td>
| delete the location of the cursor one character at a time before td> tr>
| dd td>
| delete line cursor td> tr>
| NDD td>
| lines from the cursor downward to delete n td> tr>
| yy td>
| copy line cursor td> tr>
| nyy td>
| copy from the cursor down n rows td> tr>
| p td>
| characters paste to the cursor to the buffer td> tr>
| n td>
| recovery before an action td> tr>
| : the set Nu td>
| cancel line number td> tr>
| : set nonu td>
| cancel td> tr> tbody> table> | Bottom row mode function key |