Register now and start sharing your code snippets.
-->

Recording a macro in vim

Shell Script (Bash) posted about 1 year ago by marko

Vim is a powerful text editor. All powerful text editors support some kind of macro’s. Here’s how vim does it.

   1  qa - start recording a macro into register 'a'
   2  q - stop recording

Running the macro.

   1  @a - run the macro in register 'a'
   2  @@ - repeat the last macro that was run
   3  10@a - run the macro in register 'a' ten times

Tagged vim, gvim, macro