Brisk Vim (ii): Insert

Source: Internet
Author: User

In the previous section we talked about the movement in vim, since it has been able to navigate between the screen and the cursor.

So, let's talk about the insert command now.

I do not know how many new vim novice and I was (last year), vowed to think only I can insert

Alas, it is ridiculous to think now, it is the result of many editors in Windows

A little mouse, mother no longer have to worry about my text inserted ... Tragedy!

Okay, let's get rid of the past, it's probably not too late to fight from now on

This is my "light Vim series" In the second section, each section will be updated constantly, add more skills in the

Vim Novice refueling, we summarize together, and work hard to practice ...

Basis

Character position insertion

I            insert a before the cursor            append after the cursor

You see, actually just starting with these two is enough, this is the most basic

Why do you say that? Because you can rely on the move command in the previous section to reach any position, and then strongly insert

Do not forget that one of the most important techniques in Vim is the use of inter-command coordination

Advanced

Row position Insertion

A append I at the end of a line insert o at the beginning of the line            insert the next line at the            cursor position to open a new row insertion            O opens a            new row in the position of the cursor

Of course, if you think you move the cursor first and then insert or append slowly, then you should use this method

They are in line units.

Here, I still need to remind you that the number of times the command was added to represent the number of executions

TIPS1:10i*<esc> First Enter 10, then enter I, then enter the * number, and finally press <Esc>

This allows you to enter 10 at the beginning of a line *

    

tips2: same,5o###<esc> first enter 5, then enter O, then enter # # #, and finally press <Esc>

This allows you to insert # # # At the beginning of each line in the following 5 rows

    

Look, this makes it easier to enter duplicate text, right, you can try to expand your mind ...

But I'm still going to take pains to remind you that the combination of commands is one of the most important tricks.

Merge rows

Sometimes you might want to merge two lines.

    

J            Merge two lines

    

You just need to move the cursor to the first line, then press 3 times J to

What makes me feel strange is that I use 3J directly but only two rows, 4J to merge 3 rows

Who's going to tell me why

Thanks http://www.cnblogs.com/nerxious/archive/2012/12/21/2827774.html

Brisk Vim (ii): Insert

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.