Commands for Vim Macros

q<register>                                        start recording into <register>        (ex: qq, qw, qe, q any char)

q (when rec)                                      end recording

@<register>                                      execute macro saved in <register> (ex: @q, @w, @e)

<num>@<reg>                                  execute macro saved in <reg> <num> times

@@                                                    repeat last macro

:g/<pattern>/normal @<register>   run macro every time we match the pattern

:reg(isters)                                         check the contents of all registers

:reg <reg_id>                                     check the contents of a given register (this can be chained with several registers, Ex: qwe checks register q, w, and e)

let @<reg_id>='<commands>’          to manually create macros

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s