How do I apply a macro to every line in a specific range without running it manually each time?
:[range]normal @q
The :[range]normal @q command replays the macro in register q on every line within a given range.
162 results for "{n}G"
:[range]normal @q
The :[range]normal @q command replays the macro in register q on every line within a given range.
/pattern\_s\+next
Vim's regular expressions support multi-line matching through underscore-prefixed atoms.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
<C-o> and <C-i>
Vim maintains a jump list of positions you have visited.
qaqqa{actions}@aq@a
A recursive macro is a macro that calls itself at the end of its recording.
<C-o> / <C-i>
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.
!{motion}{cmd}<CR>
In normal mode, !{motion} sends the lines covered by the motion to a shell command's stdin and replaces them with stdout.
:bufdo {cmd}
:bufdo executes an Ex command in each open buffer in sequence, cycling through every buffer in the buffer list.
getreg()
The getreg({name}) function returns the content of any register as a string.
/foo\_.*bar
Vim's default .
:[range]norm @{register}
The :normal command executes normal-mode keystrokes on each line in a range — including macro playback.
:snomagic /foo.\+/bar/<CR>
When a pattern is mostly literal text with just a little regex, default magic mode can force extra escaping and make substitutions harder to read.
\%(...\)
Vim's standard grouping syntax \(.
luaeval('lua_expression')
When you have existing Vimscript code that needs to reach into Neovim's Lua ecosystem, luaeval() is the bridge.
crs / crc / crm / cru
The vim-abolish plugin adds coercion operators that instantly convert the word under the cursor between common naming conventions.
plugins #editing #text-objects #plugins #normal-mode #formatting
:set shortmess+=I
The shortmess option is a string of single-character flags that tell Vim which messages to suppress or abbreviate.
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
:Telescope resume
The :Telescope resume command reopens the most recent Telescope picker, restoring the exact query string, filtered results, and cursor position from the last ti
##
The ## special token expands to the names of all files currently in Vim's argument list.
cr{s/m/c/k/u}
The vim-abolish plugin provides cr{type} coercions that instantly convert the word under the cursor to a different naming convention.