How do I use the expression register in a mapping to insert dynamic values?
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
210 results for "insert mode"
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
<C-y> and <C-e>
In Insert mode, copies the character at the same column position from the line above the cursor, and copies the character from the line below.
<C-r>{register}
Pressing followed by a register name in insert mode inserts the contents of that register at the cursor position without leaving insert mode.
<C-r>a
In insert mode, press followed by the register name.
<C-r>=42*7<CR>
In insert mode, press = to access the expression register, type a math expression like 42*7, and press Enter to insert the result (294).
<C-v>jjI text <Esc>
Enter visual block with , select lines with j, press I to insert before the block.
iabbrev
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.
:let &t_SI = "\e[6 q"
Modern terminals support cursor shape changes via escape sequences.
<C-v>{char}
When you need to insert a literal tab character despite expandtab being set, or embed a control character like ^M (carriage return) into your text, in insert mo
editing #editing #insert-mode #special-characters #control-characters
A
The A command moves the cursor to the end of the current line and enters insert mode.
"%p
Vim has several read-only registers that hold special values.
<C-g>u
By default, Vim treats an entire Insert mode session (from entering Insert mode to pressing ) as a single undo unit.
<C-v>u{code} in insert mode
In insert mode, u followed by a 4-digit hex code inserts the Unicode character at that code point.
C
The C command deletes everything from the cursor position to the end of the line and places you in insert mode.
80i-<Esc>
Vim's insert commands accept a count prefix that repeats everything you type.
<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.
<C-w>
Pressing in insert mode deletes the word before the cursor instantly, without requiring you to switch to normal mode.
:r !command
The :r !command command executes a shell command and inserts its output directly into the current buffer below the cursor line.
<C-k>{char1}{char2}
Vim has a built-in digraph system that lets you insert hundreds of special characters by typing two-character mnemonics.
editing #editing #insert-mode #special-characters #unicode #productivity