How do I control automatic text wrapping and comment formatting in Vim?
The formatoptions setting controls how Vim automatically formats text as you type — including comment continuation, auto-wrapping, and paragraph formatting.
category:
config
tags:
#config
#formatting
#comments
#text-wrapping
How do I quickly change an entire sentence in Vim?
The cis command deletes the entire sentence under the cursor and drops you into insert mode, ready to type a replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#motions
#prose
How do I set up automatic typo correction in Vim using abbreviations?
Vim's abbreviation feature lets you define automatic text replacements that trigger as you type.
category:
command-line
tags:
#insert-mode
#editing
#ex-commands
How do I paste the last Ex command I ran into my buffer?
The : register holds the most recently executed Ex command.
category:
registers
tags:
#registers
#ex-commands
#normal-mode
#productivity
How do I insert the same text on multiple lines at once?
Visual block mode combined with I lets you insert the same text at the beginning of multiple lines simultaneously.
category:
visual-mode
tags:
#visual-mode
#editing
#insert-mode
How do I include dictionary and spelling words in Vim's insert-mode autocomplete?
Vim's built-in completion ( / ) sources matches from buffers, included files, and tags by default.
category:
editing
tags:
#completion
#insert-mode
#spell
#editing
#config
How do I use the expression register for calculations?
The expression register = evaluates a Vimscript expression and stores the result.
category:
registers
tags:
#registers
#editing
#normal-mode
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 insert shell command output without leaving the command line?
In command-line mode, =system('command') evaluates the shell command and inserts its output into the command line.
category:
command-line
tags:
#command-line
#ex-commands
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 access Vim's built-in help system?
Vim has an extensive built-in help system.
category:
command-line
tags:
#command-line
#ex-commands
How do I configure Vim's built-in auto-completion?
:set completeopt=menu,menuone,noselect
The completeopt option controls the behavior of the completion popup menu.
category:
config
tags:
#config
#completion
#ex-commands
How do I create a custom key mapping?
The :nnoremap command creates a non-recursive normal mode mapping.
category:
config
tags:
#config
#ex-commands
How do you use the alternate file register?
The # register holds the alternate (previously edited) filename.
category:
registers
tags:
#registers
#alternate
#file
How do I return to normal mode from absolutely any mode in Vim?
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
category:
navigation
tags:
#normal-mode
#insert-mode
#visual-mode
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 change the content between HTML tags without manually selecting it?
The cit command deletes everything between the nearest pair of HTML/XML tags and drops you into insert mode, ready to type the replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#html
#tags
How do I auto-complete words in insert mode without any plugins?
Vim has a powerful built-in completion system that requires zero plugins.
category:
editing
tags:
#editing
#insert-mode
#completion
#productivity
How do I replace a single character without entering insert mode?
The r{char} command replaces the character under the cursor with {char} without ever entering insert mode.
category:
editing
tags:
#editing
#normal-mode
How do I use Vim as an inline calculator with the expression register?
The expression register ("=) evaluates Vimscript expressions and returns the result.
category:
registers
tags:
#registers
#insert-mode
#expression
#calculator
#vimscript