How do I insert a literal control character or special key in insert mode?
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
category:
editing
tags:
#editing
#insert-mode
#special-characters
#control-characters
How do you configure insert-mode completion behavior?
set completeopt=menu,menuone,noselect
Configure completeopt to control the completion popup: menu shows popup, menuone shows even for single match, noselect doesn't auto-select.
category:
config
tags:
#config
#completion
#popup
How do I insert a Unicode character by its code point in Vim?
In insert mode, followed by u and a 4-digit hex code inserts the Unicode character with that code point.
category:
editing
tags:
#editing
#unicode
#insert-mode
#special-characters
How do I insert a literal tab character in insert mode even when expandtab is enabled?
When expandtab is set, pressing the Tab key inserts spaces instead of a real tab character.
category:
editing
tags:
#insert-mode
#editing
#indentation
#tabs
How does Ctrl+C differ from Escape when exiting insert mode, and why does it matter?
exits insert mode immediately but silently skips two important side effects that (and its equivalent ) always trigger: abbreviation expansion and InsertLeave au
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#autocmds
How do I insert text at the beginning of a line?
The I (uppercase) command moves the cursor to the first non-blank character of the current line and enters insert mode.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
How do I run a single normal-mode command without leaving insert mode?
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#motions
How do I access the text from my last insert session?
The .
category:
registers
tags:
#registers
#editing
#normal-mode
How do I insert a blank line above or below the current line without entering insert mode?
Using :put ='' with an empty expression lets you insert blank lines in normal mode without ever entering insert mode.
category:
editing
tags:
#editing
#normal-mode
#ex-commands
#expression-register
#blank-line
How do I insert the result of a Vim expression or calculation directly into text?
The expression register ("=) lets you evaluate any Vim expression and insert its result as text.
category:
registers
tags:
#registers
#insert-mode
#editing
#ex-commands
How do I insert special Unicode characters and symbols using Vim's built-in digraph system?
Vim's digraph system lets you type hundreds of special characters — arrows, fractions, accented letters, currency symbols, and more — using intuitive two-ch
category:
editing
tags:
#insert-mode
#editing
How do I paste register contents literally without triggering mappings in insert mode?
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
category:
registers
tags:
#registers
#insert-mode
#paste
#literal
How do I center the screen on my cursor without leaving insert mode?
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
category:
navigation
tags:
#navigation
#insert-mode
#scrolling
#normal-mode
How do I programmatically exit insert mode from an autocommand or Vimscript function?
:stopinsert is an Ex command that immediately exits insert (or replace) mode and returns to normal mode.
category:
command-line
tags:
#insert-mode
#ex-commands
#autocommands
#normal-mode
How do I do math calculations without leaving insert mode?
The expression register (=) lets you evaluate Vimscript expressions on the fly and insert the result directly into your text.
category:
registers
tags:
#editing
#insert-mode
#registers
#productivity
#math
How do I evaluate expressions and insert results inline in Vim?
The expression register (=) is one of Vim's most powerful yet underused features.
category:
registers
tags:
#registers
#insert-mode
#ex-commands
#editing
How do I paste multiline clipboard text as a comma-separated list in Insert mode?
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
When you paste from the system clipboard into code or config, multiline text often needs to be flattened first.
category:
registers
tags:
#registers
#insert-mode
#expression-register
#text-processing
How do I insert the same text multiple times without a macro or copy-paste?
Vim's insert commands accept a count prefix that repeats everything you type.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
#formatting
How do I paste the text I just typed in insert mode?
The ".
category:
registers
tags:
#registers
#editing
#insert-mode
#normal-mode
#productivity
How do I copy a character from the line directly above or below while staying in insert mode?
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.
category:
editing
tags:
#insert-mode
#editing
#copy