9. Text Editor - 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:

Check vim's definition and usage
Create File
|
|

Create a new file
Command Mode
Vim opens a file in command mode:

Command mode
Help
We can view the command-related help by the :help command:
|
|

Before pressing the Enter key

After pressing the Enter key
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:

This is shown at the left bottom of the screen
Let’s write something:

We have wrote something in the insert mode
We can press the ESC key to go back to command mode:

The -- Insert -- text shown at the left bottom of the screen has gone
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:
|
|

Before pressing the Enter key
After we save the file, we can see some basic information about the file at the bottom of the screen

After pressing the Enter key
Exit
If we have saved the written content, we can exit vim by :q command and press Enter:
|
|

Before pressing the Enter key
Edit File
Opening a file is almost the same as creating a file:

Edit an existing 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:

After opening an existing file
Author Dong Chen
LastMod Sun Feb 10 2019