macro snippets

Recording a macro in vim

Tagged vim, gvim, macro  Languages bash

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

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

Running the macro.

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