How do I understand which register Vim uses for each operation?
:help registers
Vim has 10 types of registers, each serving a specific purpose.
161 results for "paste"
:help registers
Vim has 10 types of registers, each serving a specific purpose.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
<C-r>=expression<CR>
The expression register ("=) evaluates Vimscript expressions and returns the result.
registers #registers #insert-mode #expression #calculator #vimscript
@:
The @: command re-executes the most recently run Ex command (any command starting with :).
command-line #command-line #ex-commands #repeat #normal-mode #productivity
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
command-line #command-line #terminal #workflow #productivity
:earlier
Vim's undo history is not just a linear list of changes — it records timestamps too.
<C-v>jjjI
Visual block mode combined with I lets you insert the same text at the beginning of multiple lines simultaneously.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
"Ayy
The "Ayy command appends the current line to register a instead of overwriting it.
:'<,'>s/\n/, /g
Vim's J command joins lines with a single space, but sometimes you need a custom separator like a comma, pipe, or semicolon.
editing #editing #ex-commands #visual-mode #substitution #lines
Write keystrokes in buffer, then "qy$
Instead of recording a macro in real-time (where mistakes mean starting over), you can write the keystrokes as text in a buffer, edit them visually, and then ya
macros #macros #editing #registers #workflow #best-practices
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
:%s//new/g
Leaving the search field empty in a :s command tells Vim to reuse the last search pattern from / or .
search #search #substitution #ex-commands #regex #productivity
<C-v>
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
qA
If you finish recording a macro and realize you forgot a step, you don't need to re-record the whole thing.
macros #macros #registers #normal-mode #editing #productivity
:GBrowse
The vim-fugitive plugin combined with vim-rhubarb (for GitHub support) provides the :GBrowse command, which opens the current file on your repository's web host
<C-x><C-l>
The command triggers whole-line completion in insert mode.
<C-w>
Pressing in insert mode deletes the word before the cursor instantly, without requiring you to switch to normal mode.
<C-o>{cmd}
Pressing in insert mode lets you execute one normal mode command and then automatically returns you to insert mode.
<Leader>tm
The vim-table-mode plugin by Dhruva Sagar turns Vim into a powerful table editor that automatically formats and aligns table columns as you type.