Insert mode
Recall the last lesson
-
We summarized the way of mode switching
- Command mode
Normal mode
- Baseline command line mode
Command mode
- Command mode
-
How to open the help file correctly
:h
-
Using the mouse in a document
set mouse=a
- It is recommended not to use the mouse
-
Use full keyboard to jump in and out hyperlinks
- ctrl+]
- ctrl+o
-
Two manuals for help files
- User help manual
- Reference help manual
- This time, let’s insert the content and modify the document
Insert mode
If you want to insert content, you should enter the insert mode(Insert mode)
- First, let’s open the last one
oeasy.txt
ls -l . > oeasy.txt
vi oeasy.txt
- Then how to enter the insert mode?
- We use
:help insert
See if there are any orders
-
We need to exit help mode first
:q
- Then pressiEnter insert mode
-
After entering insertion mode
lower left quarter
The status bar displays--Insert--
- This means that you have entered insertion mode
- Always pay attention to the lower left corner
- The lower left corner is like a small map
- It is where the overall situation is managed
-
If you don’t enter insert mode
- Maybe it’s because I’m in the new help
- before
:q
Exit help
Insert text
- In insert mode, we can type at will
- The key is no longer a command, but a character
- You can type a colon when you enter
-
What if you want to move the position after input?
- escReturn to command mode
Normal mode
- perhapsctrl+cReturn to command mode
Normal mode
- Try to choosectrl+cBecause you can keep your hands in the right position
- Right little fingerctrl+Right index fingerc
- escReturn to command mode
-
Note that after returning to command mode
- The status bar in the lower left corner is no longer displayed
--Insert--
- Instead, it goes back to blank
- The status bar in the lower left corner is no longer displayed
- Observe the lower left corner
- Always pay attention
Document details
- Note that where there is content, it is the specific text content
- Where there is no content
- There will be
tilder(~)
Prompt tilder(~)
It means nothing, just nothing
usei
Command to enter insert mode
- PressiEnter the insertion mode again
- Pressescorctrl+cReturn to command mode
- Can useiandctrl+cSwitch mode repeatedly
- Observe the lower left corner
Help details
i
What exactly does that mean?- sure
:h
Give him a minute :h i
namelyhelp
oncei
What exactly does the order do
- thatctrl+cWhat do you mean?
Query shortcut
- What won’t
:h
what :h ctrl-c
Just help us find itctrl-c
What do shortcuts do
- Similarly, there are
:h ctrl-g
- CTRL+GCorresponding to
:f[ile]
command - You can view the current file information
Try to exit
- input
:q
Wish to quit - But the screen is shown below
- Input according to his requirements
:q!
cat oeasy.txt
The display file has not been modified- original
:q!
Force quit without saving - Embarrassing, although it hasn’t been saved successfully
- But it was really inserted!
- Let’s summarize first
summary
- This time we are in insert mode
- Using commands in normal modei
- Use in insert modeescReturn to normal mode
- use
:!q
Do not force exit - Hey ~ it seems that we can only save it next time
- We’ll talk about it next time!