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