How do I jump to the start or end of the last changed, yanked, or pasted text using automatic marks?
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
245 results for ""+p"
'[ and ']
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
<Up>
In Vim's command line, and navigate history in prefix-filtered mode — they only cycle through past commands that begin with whatever you have already typed.
ysiw<em>
The vim-surround plugin makes wrapping text in HTML or XML tags effortless.
<C-r><C-o>
When you paste a register in insert mode with {reg}, Vim inserts the text as if you had typed it — which means auto-indent, abbreviation expansion, and other
registers #registers #insert-mode #paste #autoindent #editing
"aP
Use "aP (uppercase P) to paste the contents of register a before the cursor position, as opposed to "ap which pastes after.
%:e
Vim exposes the current filename as % in Ex commands, and you can apply modifiers to extract specific parts of the path.
"0p in visual mode
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
"*
On X11 Linux systems, there are two independent clipboard-like buffers: the primary selection (") and the clipboard ("+).
qaddpq
Record a macro that deletes the current line with dd and pastes it below the next line with p.
<C-r><C-r>x
When you press x in insert mode to paste a register, Vim inserts the text "as if you typed it" — meaning autoindent, textwidth, and other insert behaviors can
dd
The dd command deletes the entire current line, regardless of where the cursor is positioned on that line.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
:set backupdir=~/.vim/backup// directory=~/.vim/swap//
How it works By default, Vim creates backup files (ending in ~) and swap files (ending in .
:wincmd
:wincmd {key} executes any {key} window command from the Ex command line or from inside a Vimscript function.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
D
The D command deletes everything from the cursor position to the end of the current line.
`[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
<C-w>z or :pclose
The preview window shows file contents temporarily without switching your editing context.
buffers-windows #buffers-windows #quickfix #preview #navigation
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
:move +1 / :move -2
The :move command relocates lines to a specific position without using delete and paste.