How do I convert a recorded macro into a permanent key mapping?
:let @q then use in nnoremap
Macros are stored in registers as plain keystroke strings.
197 results for "registers"
:let @q then use in nnoremap
Macros are stored in registers as plain keystroke strings.
iabbrev
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
:g/pattern/y A
The :g/pattern/y A command yanks every line matching the pattern and appends it to register a.
command-line #command-line #registers #global #ex-commands #filtering
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
<C-w>n
n creates a new empty buffer and opens it in a horizontal split above the current window.
"/p
Vim stores the last search pattern in the search register "/.
<C-r>=
The expression register (=) lets you evaluate Vimscript expressions on the fly and insert the result directly into your text.
registers #editing #insert-mode #registers #productivity #math
<C-r><C-a>
When you are in command-line mode, inserts the word under the cursor (alphanumeric and _ only).
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
:@a
How it works The command :@a executes the contents of register a as an Ex command.
:let @/ = 'pattern'
Writing to the @/ register via :let @/ = 'pattern' sets Vim's last-search pattern directly — without performing a search or moving the cursor.
gp
The standard p command pastes text after the cursor but leaves the cursor at the beginning of the pasted text.
:let @q = '{keystrokes}'
You can assign a string directly to any register using :let @{reg} = '.
<C-r>0
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
<C-r><C-r>{register}
In insert mode, {register} pastes the register's contents but runs it through Vim's insert-mode processing — including autoindent, textwidth wrapping, and for
<C-r><C-o>{reg}
When you use a in insert mode to paste register a, Vim inserts the text as if you typed it character by character.
"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
P (in visual mode)
When you paste over a visual selection using p (lowercase), Vim replaces the selection with your register contents — but the replaced text overwrites your unn
:set clipboard=unnamedplus
Setting clipboard=unnamedplus makes Vim's default yank and paste use the system clipboard.