How do I insert the current filename into the buffer or use it in commands?
"%p
Vim has several read-only registers that hold special values.
"%p
Vim has several read-only registers that hold special values.
<C-v>u{hex}
In insert mode, pressing followed by u and a 4-digit hexadecimal codepoint inserts the corresponding Unicode character directly into the buffer.
iabbrev
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
<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-a> (insert mode)
While in insert mode, pressing re-inserts the exact text you typed during your previous insert session.
<C-x>s
When spell checking is enabled (:set spell), s in insert mode opens a popup menu of suggested corrections for the most recently flagged misspelled word — with
"=
The expression register ("=) lets you evaluate any Vim expression and insert its result as text.
<C-r><C-r>{register}
In insert mode, {reg} pastes from a register but treats certain bytes as key inputs — so a register containing \n triggers a newline, \x08 triggers backspace,
:set complete+=kspell
Vim's built-in completion ( / ) sources matches from buffers, included files, and tags by default.
<C-k>
Vim has a built-in digraph system that lets you type special characters using short two-character codes.
<C-o>zz
When you are typing in insert mode and the cursor drifts near the top or bottom of the screen, you normally have to press , then zz, then i or a to continue edi
<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
80i-<Esc>
Vim's insert commands accept a count prefix that repeats everything you type.
<C-a> (in insert mode)
While in insert mode, pressing re-inserts whatever text you typed during your previous insert session.
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
<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-t> and <C-d> in insert mode
When typing in insert mode, you can adjust the current line's indentation without leaving to normal mode.
<C-t> and <C-d>
When you're typing in insert mode and realize the current line needs more or less indentation, you don't have to leave insert mode to fix it.
<C-\><C-n>
While works to leave insert or visual mode, it does not work in every situation — particularly in terminal mode (:terminal), where is consumed by the running
<C-o> (in insert mode)
Pressing while in insert mode drops you into a special "insert-normal" mode where you can execute exactly one normal mode command, then immediately return to in