How do I insert the output of any Vim Ex command directly into the current buffer?
The :put =execute('{cmd}') idiom inserts the output of any Vim Ex command as text in your buffer.
category:
registers
tags:
#registers
#ex-commands
#command-line
#normal-mode
How do I change the text inside parentheses?
The ci( command deletes everything inside the nearest pair of parentheses and places you in insert mode, ready to type a replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#insert-mode
How do I insert the full WORD under the cursor (including slashes and dots) into the command line?
When you are in command-line mode, inserts the word under the cursor (alphanumeric and _ only).
category:
command-line
tags:
#command-line
#editing
#registers
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 open a new line above the cursor and start typing?
The O (uppercase) command opens a new blank line above the current line and places you in insert mode, ready to type.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
How do I create text abbreviations that auto-expand while typing in Vim?
:iabbrev {abbr} {expansion}
How it works The :iabbrev command creates abbreviations that automatically expand when you type them in insert mode.
category:
editing
tags:
#editing
#insert-mode
#ex-commands
How do I limit the height of Vim's insert-mode completion popup menu?
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.
category:
config
tags:
#config
#completion
How do I execute the current line as a shell command and insert the output?
The :.
category:
command-line
tags:
#editing
#ex-commands
#shell
#filtering
#productivity
How do I enable syntax-based completion without plugins using completefunc?
:set completefunc=syntaxcomplete#Complete
If omnifunc is unavailable for a filetype, Vim can still offer meaningful completion by using syntax groups.
category:
config
tags:
#config
#completion
#insert-mode
#filetype
How do I create a dynamic abbreviation that inserts live content like the current date?
:iabbrev <expr> {trigger} {expression}
The flag on :iabbrev turns the right-hand side into a Vimscript expression that is evaluated at expansion time rather than stored as a literal string.
category:
config
tags:
#config
#insert-mode
#abbreviations
#ex-commands
How do I automatically close brackets and quotes as I type?
auto-pairs automatically inserts closing brackets, parentheses, and quotes when you type the opening one.
category:
plugins
tags:
#plugins
#insert-mode
#editing
How do I prepend text to every line in a visual block selection?
When you need to add the same prefix to many adjacent lines, Visual Block insert is faster and safer than repeating macros or substitutions.
category:
visual-mode
tags:
#visual-mode
#editing
#blockwise
#insert-mode
How do I get the current Vim mode as a string for use in expression mappings or the statusline?
The mode() function returns a short string identifying the current editing mode — 'n' for Normal, 'i' for Insert, 'v' for Visual character-wise, 'V' for Visua
category:
macros
tags:
#macros
#normal-mode
#visual-mode
#insert-mode
#editing
How do I append text to the end of multiple lines that have different lengths?
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.
category:
visual-mode
tags:
#visual-mode
#editing
#insert-mode
How do I enable an alternative digraph entry mode where I type two characters then backspace?
With :set digraph enabled, you can enter special characters in insert mode by typing the two-character digraph code followed by (backspace).
category:
config
tags:
#insert-mode
#digraphs
#unicode
#special-characters
#config
How do I change the cursor shape for different Vim modes in the terminal?
Modern terminals support cursor shape changes via escape sequences.
category:
config
tags:
#config
#cursor
#terminal
#visual-feedback
How do I use a macro to wrap each word in quotes?
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.
category:
macros
tags:
#macros
#editing
#normal-mode
#insert-mode
How do I use the expression register inside a macro for dynamic values?
How it works The expression register (=) lets you evaluate Vimscript expressions and insert the result.
category:
macros
tags:
#macros
#registers
#insert-mode
How do I use keyword completion that searches included files and headers in Vim?
Vim's completion mode searches for keyword matches not just in the current buffer, but also in all files reachable via include directives (e.
category:
editing
tags:
#completion
#insert-mode
#editing
How do I configure Vim's completion menu to show a popup without auto-selecting the first candidate?
:set completeopt=menuone,noselect
By default, Vim's and completion can auto-insert the first match, or only show a menu when there are multiple matches.
category:
config
tags:
#config
#completion
#insert-mode