How do I add or subtract a specific number to a number under the cursor?
{count}<C-a> / {count}<C-x>
While increments and decrements a number by 1, you can prefix either with a count to add or subtract a specific amount.
2277 results for "@a"
{count}<C-a> / {count}<C-x>
While increments and decrements a number by 1, you can prefix either with a count to add or subtract a specific amount.
qagUiwWq2@a
Macros are most powerful when they encode both the edit and the movement to the next target.
:[range]normal @a
The :[range]normal @a command runs a recorded macro against every line in a given range.
macros #macros #registers #ex-commands #normal-mode #advanced
:let @a=getline('.')<CR>@a
How it works Instead of recording keystrokes interactively, you can write a sequence of Vim commands as plain text in your buffer and then execute that text as
:'<,'>norm @a
Combining :normal with a visual range lets you replay a macro on each line of a selection individually — far more targeted than recursive macros or @@ repeati
set wildcharm= then nnoremap b :b
wildcharm sets the key that triggers wildmenu expansion inside mappings.
:'<,'>g/let /normal! A;<CR>
When you need a structural edit in part of a file, Visual mode ranges combine well with :global and :normal!.
visual-mode #visual-mode #command-line #ex-commands #editing
vim.lsp.buf.code_action({ apply = true, filter = function(a) return a.isPreferred end })
When an LSP server marks a code action as isPreferred (e.
:%s/pattern/\r/g
In the replacement part of :s, \r inserts a newline.
:%norm A;
The :%norm command runs normal mode commands on every line in the file (or a range).
:'<,'>normal @a
The :'normal @a command executes the macro stored in register a on every line within the current visual selection.
:%s/pattern/\=@a/g
How it works In Vim's substitute command, the replacement string can be a Vimscript expression when prefixed with \=.
:let @a = @/
Vim stores the last search pattern in the special / register (@/).
`a vs 'a
Vim has two ways to jump to marks: backtick (` `) jumps to the exact line AND column, while apostrophe (') jumps to the line only, positioning the cursor at the
qa ... q ... @a
Macros let you record a sequence of commands and replay them.
:let @a = "value"
The :let @{reg} = expr command lets you assign any string or expression directly into a named register without entering insert mode or performing a yank.
vi{a{
In visual mode, you can expand your selection to include outer nested blocks by pressing additional text object commands.
set mouse=a
Setting mouse=a enables mouse support in all modes.
:let @+ = @a
If you already have carefully collected text in a named register, re-yanking just to reach the system clipboard is noisy and error-prone.
:call setreg('b', getreg('a'), getregtype('a'))
Plain register copies like :let @b = @a move text, but they can lose important metadata about register type.