How do I create a recursive macro that runs until it encounters an error?
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.
2125 results for "i" a""
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.
:undojoin | normal! A;<CR>
When you automate edits from Ex commands, Vim usually creates a separate undo entry for each change.
:'<,'>sort /\%20v/
When lines contain aligned columns, plain :sort often gives the wrong order because it compares from column 1.
visual-mode #visual-mode #sorting #text-processing #command-line
:packadd termdebug | Termdebug ./a.out
If you only debug occasionally, loading termdebug on demand keeps startup lean while still giving you an in-editor GDB workflow.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
:e +{line} {file}
The :edit command accepts a +{cmd} prefix that executes an Ex command immediately after the file is loaded.
command-line #buffers #ex-commands #navigation #command-line
:[range]luado {lua-expr}
Neovim's :luado command runs a Lua expression on each line of a range, allowing you to transform text using the full power of Lua's string library.
:set mousemodel=extend
If you use the mouse occasionally in Vim, mousemodel=extend makes selection behavior much more predictable.
:s/\v(pattern1)(pattern2)/\2\1/
Vim's substitute command supports capture groups (also called backreferences), which let you rearrange matched portions of text.
vip=
Pressing = in visual mode re-indents all selected lines according to the current filetype's indent rules — the same engine used by == for a single line, but a
visual-mode #visual-mode #indentation #editing #text-objects
:let @a = @"
Vim's :let command lets you read and write register contents as strings, making it possible to copy, combine, or modify register values without ever leaving the
<C-v>{motion}I{text}<Esc>
Visual block mode () lets you select a rectangular region across multiple lines.
mA and 'A
Vim has two tiers of marks.
:reg a b c
The :reg (alias :registers) command accepts a string of register names as its argument.
:let @q = @a . @b
Macros in Vim are stored as plain text in named registers.
b: w: t: s:
Vimscript variables are prefixed with a one-letter scope identifier followed by a colon.
<C-a> (command-line)
Pressing on the command line expands all current completion matches into the command at once, rather than cycling through them one at a time with .
:let @q = 'keystrokes'
You can assign a string directly to any register using :let, turning it into a macro instantly.
/\%d{decimal}
Vim's regex engine supports special atoms that match characters by their numeric value rather than their glyph.
:let @q = "dd"
Macros are just strings stored in named registers.