Recording a macro is a great way to perform a one-time task, or
to get things done quickly when you don't want to mess with Vim
script or mappings, or if you do not yet know how to do it more
elegantly. In Vim, the word "macro" may refer to: - A sequence
of commands recorded to a register (this tip). - A mapping to
expand a sequence of typed keys to a longer sequence (see
tutorial). - A script written in the Vim script language (stored
in a file with extension .vim– see :help script). Recording a
macroEdit Each register is identified by a letter To enter a
macro, type: To execute the macro <number> times (once by
default), type: So, the complete process looks like: | || start
recording to register | | ||your complex series of commands| |
||stop recording| | ||execute your macro| | ||execute your macro
again| Running a macroEdit Use this mapping as a convenient way
to play a macro recorded to register :nnoremap <Space> @q -
Start recording keystrokes by typing - End recording with
q(first press Escape if you a