vim recording and execution macro 2019-06-16 12:27
Using macros to perform repetitive operations is a very efficient way. In this page I will show you how to use it.
Recently I am translating some English articles into Chinese. I need to enter two Chinese spaces at the beginning before I translate a paragraph. I plan to use macros to do this boring thing.
recording
- press
qa
in normal mode. "recording" will show in the bottom. This means you are recording macro and save it in "a" register - press
o
to move cursor to next line. - press Ctrl+v and
u
to prepare input unicode character. - the number of chinese space is
3000
in unicode. then press 3000. - press
esc
to return normal mode, pressq
to save current macro
execution
After recording the macro successfully you can use @<your_macro_name>
in my case is @a
to execute the macro.
EOF