How do I evaluate expressions and insert results inline in Vim?
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
<C-r><C-o>{register}
The standard {reg} pastes register contents in Insert mode, but Vim may auto-indent multi-line text to match the current indentation level — sometimes manglin
<C-r>0
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
<C-g>u
By default, Vim treats an entire Insert mode session (from entering Insert mode to pressing ) as a single undo unit.
<C-t> / <C-d>
While in Insert mode, you can adjust indentation without switching back to Normal mode.
<C-r>a
In insert mode, press followed by the register name.
auto-pairs plugin
auto-pairs automatically inserts closing brackets, parentheses, and quotes when you type the opening one.
<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-v>jj$A
Combining visual block mode with $ and A lets you append text at the end of multiple lines, even when the lines have different lengths.
:iabbrev {abbr} {expansion}
How it works The :iabbrev command creates abbreviations that automatically expand when you type them in insert mode.
:iabbrev teh the
Vim's abbreviation feature lets you define automatic text replacements that trigger as you type.
qa<C-r>=expression<CR>q
How it works The expression register (=) lets you evaluate Vimscript expressions and insert the result.
qabi"<Esc>ea"<Esc>wq
How it works This macro wraps the current word in double quotes and moves to the next word, making it easy to repeat across a line or file.
<C-v>u{code}
In insert mode, followed by u and a 4-digit hex code inserts the Unicode character with that code point.
<C-h> / <C-w> / <C-u>
Vim provides three levels of deletion directly in insert mode, so you don't need to switch to normal mode for small corrections.
<C-r>=expression<CR>
The expression register ("=) evaluates Vimscript expressions and returns the result.
registers #registers #insert-mode #expression #calculator #vimscript
<C-r>/
Vim stores your last search pattern in the / register.
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.
<C-y>,
The emmet-vim plugin brings the full power of Emmet (formerly Zen Coding) to Vim, letting you type a short CSS-like abbreviation and expand it into a complete H