Why should I learn vim?
- All Unix like systems have their own VI editor
- Some software's editing interface will automatically adjust the VI
- As an upgraded version of VI, VIM has the program editing function, but also has the code color highlight, the identification code correctness and so on function
The above advantages lay the absolute position of vim in the Linux system
Two VI use 1 mode to understand
VI has three modes, namely: General mode, edit mode, command mode. Let's get to the bottom three of these patterns.
General mode: is also the default mode, with VI open a file directly into the general mode. In this mode, you can delete characters, delete whole lines, replace characters, copy and paste operations
Edit mode: User vi Open the file into the general mode, when you just press "I i a o o r r" any one of the letters, it will enter the editing mode.
When you enter edit mode, the words "INSERT" or "REPLACE" appear in the lower left corner of the document; To exit edit mode, press the ESC key to return to normal mode
Command mode: In general mode, you can enter ":/?" in the command mode with the keyboard, and the cursor moves to the bottom line, waiting for the user to enter the next step. In this mode, users can perform common operations such as reading, saving, bulk substitution, displaying line numbers, exiting the editor, such as ": Set Nu" To display line numbers in a document
2 Common key instruction cursor movement
Copy and paste
Search and replace
Instruction in command mode
Instructions in edit mode
The use of VIM in Linux learning