Applying a VIM macro to a set of lines
- Start a macro typing
q
+ macro name (in that case wasq
as well) - Record the commands. I was using
ds'
which uses the surround plugin to delete the quotes. - Finish the recording with
q
again. - Select the lines with
V
- Apply the macro to the select lines with
:norm! @q
Reference:
- http://stackoverflow.com/questions/390174/in-vim-how-do-i-apply-a-macro-to-a-set-of-lines
- https://github.com/tpope/vim-surround