Document directory
In the previous section, we talked about the movement in VIM. Now that it is sufficient to be able to work in the screen and between the optical standard.
Now let's talk about the INSERT command.
I don't know how many new VIM users are like me (last year). I vowed that only I can be inserted.
Alas, now I think it's ridiculous to think about it. It's all because the Windows Editor is used too much.
With a mouse, Mom no longer needs to worry about text insertion ...... Tragedy!
Well, let's discard the past. It may not be too late to start from now on.
This is the second section of the brisk VIM series, which is constantly updated.
Come on with VIM! Let's sum up and practice together ......
Basic
Character position insertion
I insert a before the cursor and append it after the cursor.
You see, in fact, it is enough to use the two at the beginning. This is the most basic
Why? Because you can rely on the Move command in the previous section to reach any location, and then insert vigorously
Don't forget, one of the most important tips in VIM is the use of commands.
Advanced
Insert row position
A append at the end of A row. I insert at the beginning of A row. o open A new line in the next line of the cursor. O open A new line in the previous line of the cursor.
Of course, if you think that moving the cursor first and then inserting or appending is slow, you should use the above method.
They are in rows.
Here, I still need to remind you that adding a number before the command indicates the number of executions.
Tips1:10I * <Esc> enter 10 first, then I, enter *, and then press <Esc>
In this way, you can enter ten characters at the beginning of a line *
Tips2:Similarly, 5o ### <Esc> enter 5 first, then o, then ###, and then press <Esc>
In this way, you can insert at the beginning of each row in the following five rows ###
You can try to expand your mind ......
However, I am still tired of reminding you that command combinations are also one of the most important techniques.
Merge rows
Sometimes you may want to merge two rows
J. merge two rows
You only need to move the cursor to the first line, and then press J three times.
What makes me feel strange is that I use 3J directly, but only two rows can be merged, and only three rows can be merged in 4J.
Who will tell me why?