How do I combine two recorded macros into one without re-recording them from scratch?
:let @q = @a . @b
Macros in Vim are stored as plain text in named registers.
57 results for "line start 0"
:let @q = @a . @b
Macros in Vim are stored as plain text in named registers.
g<C-a>
The g command increments numbers across a visual selection so that each subsequent line gets a progressively higher value.
qa0f=20i <Esc>20|C= <Esc>lDjq
How it works Aligning text on a delimiter such as = without plugins requires a clever macro technique.
( ) { } [[ ]]
Vim provides structural navigation motions that move by sentences, paragraphs, and sections.
/pattern\ze followed
The \ze atom marks the end of the match, so you can match a pattern only when it appears before specific text.
:for i in range(1,5) | put ='item '.i | endfor
Vimscript's for loop is available directly from Vim's command line and can be used to generate repetitive or parameterized text without a macro or external scri
qaYp<C-a>q99@a
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
macros #macros #editing #normal-mode #automation #productivity
vim.api.nvim_create_user_command()
Neovim's Lua API provides vim.
`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
:%s/\<old\>/new/g
Wrapping your search pattern in \ word boundary anchors ensures that Vim only matches the exact whole word, preventing accidental replacements inside longer wor
nnoremap <key> :<C-u>call MyFunc(v:count)<CR>
When writing custom mappings that call Vimscript functions, a common pitfall is that any count you type before the key (e.
' vs `
Vim provides two distinct ways to jump to a mark, and they behave differently: the apostrophe ' jumps to the first non-blank character of the marked line, while
:set foldcolumn=1
Setting foldcolumn to a non-zero value adds a narrow column on the left side of each window that visually represents the fold structure of your file.
/\V<C-r><C-r>"
When your yanked text includes regex symbols like .
:<C-r>a
How it works While typing an Ex command on the command line (after pressing :), you can insert the contents of any register by pressing Ctrl-R followed by the r
:set verbosefile=/tmp/vim.log verbose=9
Vim's verbosefile option redirects all verbose tracing output to a file on disk instead of printing it to the screen.
:{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/+N or /pattern/-N
Vim's search command accepts an offset that places your cursor on a line relative to the match.
:set scrolloff=5
The scrolloff option keeps a minimum number of lines visible above and below the cursor when scrolling.
:set softtabstop=4
When expandtab is enabled, Vim inserts spaces instead of a real tab character, but without softtabstop, Backspace only deletes one space at a time — not a ful