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.
94 results for "c motion"
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.
<C-f> (in command line)
Pressing while you are already typing in the Vim command line (:), search line (/ or ?), or input prompt switches you into the command-line window with the curr
command-line #command-line #ex-commands #editing #normal-mode
<C-f> (in command-line mode)
When you're already on the Vim command line and realize you need complex edits — inserting text from multiple positions, reordering arguments, or referencing
:keepjumps normal! gg=G
Bulk formatting commands are common in cleanup sessions, but they often leave side effects in your navigation history.
<C-f>
While typing in Vim's command line (after pressing :), pressing opens the command-line window with your current, unfinished command already filled in.
<C-v>jj$A text<Esc>
Visual block mode combined with $A lets you append text to the end of multiple lines simultaneously, even when those lines have different lengths.
visual-mode #editing #visual-mode #block-mode #productivity #insert-mode
onoremap ih :<C-u>execute "normal! ?^==\+$\r:noh\rkvg_"<CR>
Vim lets you define custom text objects using operator-pending mode mappings (onoremap) and visual mode mappings (vnoremap).
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
]m / [m
When you're reviewing or refactoring C-style code, jumping by words or paragraphs is too coarse, and search can become noisy.
navigation #navigation #motions #code-navigation #normal-mode
[m
The [m motion jumps backward to the start of the nearest enclosing or preceding method definition.
g~ap
g~ap is a fast way to invert letter case across a full paragraph without entering Visual mode.
editing #editing #operators #text-objects #case #normal-mode
42G
The 42G command jumps the cursor directly to line 42 in the current file.
:set virtualedit=block,onemore
virtualedit controls whether the cursor can move to positions that do not yet contain text.
:echo getregtype('a')
The getregtype() function returns the motion type of a register's content — whether it was yanked characterwise, linewise, or as a visual block.
"1 through "9
Vim maintains a rotating history of deleted text across registers "1 through "9.
:echo strtrans(@q)
When a macro behaves unexpectedly, :echo strtrans(@q) reveals exactly what is stored in register q—including invisible control characters—as human-readable
g; and g,
Vim tracks every position where you made a change in the changelist.
:set foldopen
The foldopen option lets you specify exactly which cursor movements and commands will automatically open a closed fold.
= (in visual mode)
After making a visual selection, pressing = applies Vim's auto-indent to every selected line at once.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.