How do I increment all numbers in a visual selection by the same amount?
{Visual}<C-a>
In Visual mode, pressing increments every number within the selection by 1 (or by a given [count]).
2277 results for "@a"
{Visual}<C-a>
In Visual mode, pressing increments every number within the selection by 1 (or by a given [count]).
"ap, edit, 0"ay$
When a macro has a small mistake, re-recording the entire thing is tedious.
:argdo normal @a
The :argdo command applies any Ex command to every file in the argument list.
"ayv
Using named registers with visual mode lets you store multiple independent snippets simultaneously.
:let @a = system('cmd')
You can populate any Vim register with the output of an external shell command using :let @{register} = system('{command}').
:sp +/{pattern} {file}
The +{cmd} syntax lets you run an Ex command immediately after a file is opened.
100@a
When you give a large count to a macro — such as 100@a — Vim automatically stops replaying the macro as soon as any step inside it fails.
:g/pattern/yank A
The :g command combined with yank A (uppercase A to append) lets you collect every line matching a pattern into a single register without overwriting previous c
command-line #editing #ex-commands #global-command #registers #filtering
10@a
The 10@a command replays the macro recorded in register a exactly 10 times.
:%normal command
The :normal command executes normal mode commands programmatically on a range of lines.
:redir @a | {cmd} | redir END
The :redir command redirects the output of Ex commands to a register, file, or variable instead of displaying it on the screen.
command-line #command-line #ex-commands #registers #productivity #advanced
:let @/ = @a
Vim's search register (@/) holds the current search pattern — the same one used by n, N, *, and hlsearch highlighting.
:tab help
By default, :help opens in a horizontal split, which can feel cramped.
:right
Vim has three built-in Ex commands for text alignment that most users never discover: :right [width] right-justifies lines, :left [width] left-justifies (strips
:{range}w filename
The :w command with a range and filename saves only the specified lines to a new file.
m{A-Z}
Uppercase marks (A-Z) are global marks that remember both the file and the cursor position.
:s/,/\r/g
In Vim's substitute command, use \r (not \n) in the replacement to insert a real newline.
<C-v>jjjg<C-a>
Selecting a column of identical numbers with visual block mode and pressing g turns them into an incrementing sequence.
set nrformats+=alpha
By default, Vim's and commands only increment and decrement numbers (decimal, hex, binary).
:let @q = '{keystrokes}'
You can assign a string directly to any register using :let @{reg} = '.