Recording and playback of Vim commands
The steps are as follows:
Q + (a.. z) register name
Do what you want to do.
Q end operation
Called as @ + register
Liezi is as follows:
When writing PHP programs, we often use to create functions.
Such as
Function add_in () {
}
Now let's record the command:
Qf f is the register name
Ifunction A () {o} >
Q end
How to use it:
Add_in@f
@ @ to repeat the last call
The register recorded by the command is the same thing as the register used for the yank and * * commands
Modify the contents of the register:
G to end of file
O generate a new line
"fp puts the contents of register f on this line, and what you see is the same as editing plain text.
If you get to the beginning of the line, you must not save.
"fy$ writes the correct result to register f
Dd * * draft