9. Vim - A Powerful Linux Text Editor's Basic Usage
Contents
Vim Text editor can efficiently help us quickly create or modify some common text type files, such as configuration files:
Create File
|
|
Command Mode
Vim opens a file in command mode:
Help
We can view the command-related help by the :help command:
|
|
To go back to command mode, just type :q and press Enter:
|
|
Insert Mode
We can press the letter i on the keyboard to enter to insert mode:
Let’s write something:
We can press the ESC key to go back to command mode:
Command Mode Operations
We can do a lot of things in command mode, such as searching, undo changes, save, exit files, and other more advanced uses.
Save
We can type the :w command in command mode and press enter to save the file:
|
|
After we save the command, we can see some basic information about the file at the bottom: of the screen
Exit
If we have saved the written content, we can exit vim by :q command and press Enter:
|
|
Edit File
Opening a file is almost the same as creating a file:
The difference between an existing file and a new file is the basic information at the bottom of the screen after the file is opened, the existing file has the basic information, and the new file has nothing:
If you think the content of this article has helped you, and if you would like some more high-quality materials in the near future, please give me some modest support.
Author Dong Chen
LastMod Sun Feb 10 2019