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 create an insert-mode abbreviation that expands a short sequence into longer text?
The :iabbrev command defines insert-mode abbreviations — short character sequences that automatically expand into longer text when you type a non-keyword char
category:
config
tags:
#insert-mode
#abbreviations
#config
#editing
How do I delete everything typed on the current line without leaving insert mode?
Pressing while in insert mode deletes all characters entered since you last entered insert mode on the current line.
category:
editing
tags:
#insert-mode
#editing
#delete
#normal-mode
How do I re-insert the text from my last insert session and immediately return to normal mode?
Pressing (Ctrl + @, which is the NUL character) in insert mode inserts the same text that was typed during the most recent insert session, then immediately retu
category:
editing
tags:
#insert-mode
#editing
#undo-redo
How do I autocomplete Vim command names and their arguments while in insert mode?
The key sequence in insert mode triggers Vim command-line completion — the same completion engine used at the : command prompt.
category:
editing
tags:
#insert-mode
#completion
#editing
#command-line
How do I make Vim automatically reformat paragraphs as I type so lines stay within the textwidth?
Vim's formatoptions setting controls how automatic text formatting works.
category:
config
tags:
#config
#formatting
#ex-commands
#insert-mode
How do I look up which two-character code produces a special character when using Vim's digraph system?
:digraphs (abbreviated :dig) displays a full reference table of every digraph registered in Vim.
category:
command-line
tags:
#editing
#special-characters
#insert-mode
#command-line
How do I re-insert the exact same text I typed during my last insert mode session?
Pressing while in insert mode inserts the same text that was typed during the previous insert mode session.
category:
editing
tags:
#insert-mode
#editing
#registers
How do I speed up Vim's insert mode completion by disabling include-file scanning?
Vim's complete option controls which sources are scanned when you press or to complete a word.
category:
config
tags:
#completion
#config
#performance
#insert-mode
How do I assign a key to toggle paste mode on and off without typing :set paste each time?
The pastetoggle option assigns a single key to toggle Vim's paste mode on and off without typing :set paste or :set nopaste every time.
category:
config
tags:
#config
#paste
#insert-mode
#clipboard
#terminal
How do I insert the current date or time into the buffer using Vim's built-in expression evaluation?
:put =strftime('%Y-%m-%d')
The :put = command inserts the result of a Vimscript expression directly into the buffer as a new line.
category:
editing
tags:
#editing
#ex-commands
#registers
#insert-mode
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 do I control which sources Vim searches when triggering keyword completion with Ctrl-N?
The complete option controls which sources Vim scans when you press or for generic keyword completion.
category:
config
tags:
#completion
#config
#insert-mode
How do I create a mapping that runs an Ex command without switching modes or affecting the current state?
nnoremap <key> <Cmd>command<CR>
The special key (Vim 8.
category:
config
tags:
#config
#macros
#ex-commands
#normal-mode
#insert-mode
How do I make a macro prompt for user input at a specific point during its execution?
<C-r>=input('Enter: ')<CR>
By embedding =input('prompt: ') inside a recorded macro, you can pause the macro at any point to ask for user input and insert the result.
category:
macros
tags:
#macros
#insert-mode
#registers
#editing
How do I insert today's date into a Vim buffer using the expression register?
<C-r>=strftime('%Y-%m-%d')<CR>
The expression register ("=) lets you evaluate any Vimscript expression and insert its result inline.
category:
registers
tags:
#registers
#insert-mode
#expression-register
#dates
How do I autocomplete words from a dictionary file while typing in insert mode?
Vim's insert-mode completion system includes dictionary lookup via .
category:
editing
tags:
#completion
#insert-mode
#editing
How do I complete words using a thesaurus for synonym suggestions in Vim insert mode?
Vim's insert-mode completion includes a thesaurus mode triggered by .
category:
editing
tags:
#editing
#completion
#insert-mode
#writing
How do I scroll the buffer up or down while staying in insert mode?
<C-x><C-e> and <C-x><C-y>
While in insert mode, scrolls the window up one line and scrolls it down one line — all without leaving insert mode.
category:
editing
tags:
#insert-mode
#editing
#scrolling
How do I configure Tab and Backspace to always move by a fixed number of spaces when using expandtab?
When expandtab is enabled, Vim inserts spaces instead of a real tab character, but without softtabstop, Backspace only deletes one space at a time — not a ful
category:
config
tags:
#indentation
#config
#insert-mode
#editing