How do I select the text I just pasted or changed?
`[v`]
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
visual-mode #editing #visual-mode #marks #paste #productivity
189 results for ""+y"
`[v`]
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
visual-mode #editing #visual-mode #marks #paste #productivity
:%norm A;
The :%norm command runs normal mode commands on every line in the file (or a range).
@='A;<Esc>'<CR>
Recorded macros are powerful, but sometimes you need a quick ephemeral sequence and do not want to occupy a register.
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-x><C-k>
Vim's insert-mode completion system includes dictionary lookup via .
:%d
The % range address in Ex commands stands for the entire file — it is shorthand for 1,$ (first line to last line).
[z and ]z
The [z and ]z commands jump the cursor to the start and end of the innermost open fold containing the cursor.
> and <
How it works In visual mode, you can shift selected lines to the right or left using the > and to indent them or or shifts the selected lines one shiftwidth to
:{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
:g/pattern/normal A;
The :global command combined with :normal lets you execute arbitrary normal mode keystrokes on every line that matches a pattern.
command-line #global #normal-mode #editing #ex-commands #batch-editing
:g//d
:g//d uses an empty pattern in the global command, which instructs Vim to reuse the last search pattern.
:v/pattern/command
:v (short for :vglobal) is the inverse of :g.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
:%norm! A;
The :norm! (or :normal!) command executes normal mode keystrokes while ignoring all user-defined mappings.
ggVG
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
:iabbrev <expr> {trigger} {expression}
The flag on :iabbrev turns the right-hand side into a Vimscript expression that is evaluated at expansion time rather than stored as a literal string.
:set signcolumn=number
Setting signcolumn=number tells Neovim to display signs (diagnostics, git hunks, breakpoints) inside the line number column instead of adding a dedicated extra
<C-x><C-]>
Pressing in insert mode opens a completion menu populated from your project's tags file.
pumvisible()
The pumvisible() function returns 1 when the insert-mode completion popup menu (pum) is visible, and 0 otherwise.
<C-v>jj$A;
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.