How do I run a macro on every line in a specific line number range?
:{range} normal @{reg}
The :normal command lets you execute Normal mode keystrokes over a range of lines.
261 results for ":b#"
:{range} normal @{reg}
The :normal command lets you execute Normal mode keystrokes over a range of lines.
{visual}p
When you visually select text and press p, Vim replaces the selection with the contents of the default register and saves the replaced text into the unnamed reg
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
g+
Vim's undo history is a tree, not a linear stack.
/pattern/e+2
Vim's search command supports an offset suffix that controls where the cursor lands after a match.
])
The ]) command moves forward to the next unmatched ).
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
<C-v>{motion}I{text}<Esc>
Visual block mode () lets you select a rectangular region across multiple lines.
di(
The di( command deletes everything inside the nearest pair of parentheses without removing the parentheses themselves.
:set nrformats
The nrformats option tells Vim how to interpret numbers when you press (increment) or (decrement).
qa{actions}@aq
A recursive macro is one that calls itself as its final action, causing it to repeat indefinitely until any command in the body fails (e.
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
:NERDTreeToggle
The NERDTree plugin provides a full-featured file explorer sidebar in Vim, giving you a visual directory tree that you can navigate, search, and manipulate file
ge
The ge motion moves the cursor backward to the end of the previous word.
qaciw"<C-r>""<Esc>wq
This macro wraps the current word in double quotes by changing the word, inserting quotes around the original content, and moving to the next word.
:{range}command
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
command-line #command-line #ex-commands #ranges #editing #productivity
/pattern/e
Search offsets let you place the cursor at a specific position relative to the match.
<leader><leader>w
vim-easymotion lets you jump to any visible position by highlighting targets with unique letters.
/[[:digit:][:upper:]]
Vim supports POSIX character classes inside bracket expressions, providing a portable and readable way to match categories of characters.
C
The C command deletes everything from the cursor position to the end of the line and places you in insert mode.