Vim--macro

Source: Internet
Author: User

Cases:

    QA      some vim command    Q

This macro only records the VIM command to register a, which can be executed with the command:

@a

You can also add the number of executions:

[Email protected]

Performed 10 times

Once you have performed a @a, you can use

@@

To repeat the execution of @a

When you find that there is a register command macro is wrong, you can re-write the command macro, but also the following changes:
1, first use G (uppercase) to the end of the file, and then use O (lowercase) Nova Ga line, do not edit, with ESC exit to normal mode, in fact, to edit the macro find a place.
2. Using commands

The AP

You will see the command macro in register a appear in this line like text, and then edit the line. Editing is the same as Vim editing other files. After editing, use 0 (0) to return to the beginning of the line.

3. Then use

"Ay$

Write the correct content to register a, and finally delete the line.

Save the above macro as a file, but also use the "AP print out, you can also assign a value

Let @a= "some command of macro of vim.^["

Some Zen:

VI has "marks" and "registers".

One-to-cut an arbitrary selection of text would is to drop a mark. Ma simply use- d`a cut or to y`a copy

Use "add I ' m cutting the 'a' register

:r!cat **Ctrl-V to paste from the OS clipboard** ^D

Vim--macro

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.