Vi/vim is a text editor under the Unix/linux operating system.
Due to the nature of unix/linux files, Vi/vim can edit any file in any format.
The following are common knowledge points, for informational purposes only:
- Editing mode: Vi/vim + file path. Where the file path can be either an absolute path or a relative path. If this file does not exist, a new file will be created.
- There are two types of patterns commonly used in Vi/vim: command-line mode and input mode.
- commands to switch from command-line mode to input mode:
New (Append)
A: From the cursor position to start the new data, the data after the cursor with the new data to move forward.
A: Start adding data from the end of the column where the cursor is located.
Inserting (insert)
I: Insert data from the cursor position, and the data after the cursor moves with the new data.
I: Insert data from the first non-whitespace character in the column where the cursor is located.
Start (Open)
O: Add a new column under the Cursor column and enter the input mode.
O: Add a column above the cursor column and enter the input mode.
In instruction mode type: Q,:Q!,:WQ or: X (note: number), you will exit VI. of which: Wq and: X is to save the exit, and: Q is to exit directly, if the file has a new change, vi will prompt you to save the file and: Q command will also be invalid, then you can use: w command saved the file and then use: Q Exit, or with: Wq or: X command exit, if you do not want to save the changed file, you need command, this command will exit VI without saving the file.
Common Operations (Command-line mode):
Ctrl+f: Turn down one page
Ctrl+b: one page Up
/+ Word: Find
DD: Delete a row
Vi/vim operation