VIM generates consecutive numeric columns

Source: Internet
Author: User
Function Description: Inserting consecutive numeric columns in vim

Like what

1,

2,

3,

4,

5,

...

100,

Command: Use the Q command to record your own action sequence and then repeat the preparation:

First enter the starting number, for example enter 1 and comma, the cursor in the current line

The action sequence is as follows:

1. In normal mode, QA will put the action record into register A, can use the register according to their preference

2. Y copy entire row

3. Paste to the next line

4. F, find the comma to the right,

5. h cursor moves one character to the right

6. Ctrl + A value plus 1

7. Q Exit Record

Generated:

Depending on the number of rows to insert, such as inserting 100 rows here

Enter [email protected] in normal mode

Done!

As for complex builds, it is basically possible to combine your own requirements with the Q command.

Note: The 5th step is to have the cursor always in the single digit of the numeric value.

VIM generates consecutive numeric columns

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.