“A really useful feature of the open source editor Vim is the
macro command, which allows you to record and reply a series of
commands. To start recording, hit “q” then “a” (or any other
lowercase letter identifier). The status bar at the bottom will
show recording. Enter your commands as normal, then hit “q” again
to stop recording when you’re done. To replay the macro, type
@a.“So far, so good, but a macro saved like this will not last
between sessions. However, the macro is saved into a normal
register in the same way as yanked text. To save it permanently,
open your ~/.vimrc file in the same session, and use “ap” to paste
in the macro commands.”
Open Source Software Shortcut, Permanently Storing Macros in Vim
By
Juliet Kemp
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis