How do I stop Vim from replacing long lines with rows of '@' signs and show as much text as possible instead?
:set display+=lastline,truncate
By default, when a line is too long to fit in the window, Vim fills the remaining rows with @ characters to indicate the line continues off-screen.
category:
config
tags:
#config
#display
#long-lines
#wrap
#visual
How do I jump to the position of my last edit?
The ` .
category:
navigation
tags:
#navigation
#marks
#normal-mode
#editing
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 run the same command across all windows, buffers, or tabs?
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#batch-editing
#ex-commands
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 enable tab completion inside custom command-line mappings?
The wildcharm option designates a key that, when it appears inside a mapping, triggers wildmenu completion on the command line — just as if you had pressed in
category:
config
tags:
#config
#command-line
#completion
#mappings
How do I configure command-line tab completion to show the longest match first then cycle?
:set wildmode=longest:full,full
The wildmode option controls what happens when you press in the command line.
category:
config
tags:
#command-line
#completion
#config
How do I uppercase or lowercase the entire current line in one keystroke?
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
category:
editing
tags:
#editing
#normal-mode
#formatting
How do I lazy-load cfilter from vimrc without interrupting startup when it is unavailable?
If you share a Vim config across machines, optional plugins can cause noisy startup behavior when a package is missing.
category:
plugins
tags:
#plugins
#packadd
#quickfix
#location-list
#config
How do I always maximize the current split window when I switch focus without using plugins?
:set winwidth=999 winheight=999
Setting winwidth=999 and winheight=999 tells Vim to try to make the active window at least 999 columns wide and 999 rows tall whenever it gains focus.
category:
buffers-windows
tags:
#windows
#config
#buffers
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 quickly select an entire function body using visual mode?
The a{ (around braces) and i{ (inside braces) text objects combined with visual mode let you instantly select an entire function body or code block, regardless
category:
visual-mode
tags:
#visual-mode
#text-objects
#code-navigation
#selection
How do I invert the case of an entire paragraph with one operator command?
g~ap is a fast way to invert letter case across a full paragraph without entering Visual mode.
category:
editing
tags:
#editing
#operators
#text-objects
#case
#normal-mode
How do I navigate back through the tag stack after jumping to definitions?
When you jump to a tag definition with , Vim pushes your location onto a tag stack.
category:
navigation
tags:
#navigation
#tags
#tag-stack
#code-navigation
How do I repeat the last substitute command preserving its flags?
After running a :s/pattern/replacement/g command, you often need to repeat it on another line or range.
category:
search
tags:
#substitute
#search
#ex-commands
#editing
How do I swap two adjacent lines?
The ddp sequence swaps the current line with the line below it.
category:
editing
tags:
#editing
#normal-mode
How do I run tests from inside Vim?
vim-test provides commands to run tests from within Vim.
category:
plugins
tags:
#plugins
#ex-commands
How do I swap the contents of two split windows in Vim?
How it works The x command exchanges the current window with the next one.
category:
buffers-windows
tags:
#windows
#navigation
#normal-mode
How do I reformat text to fit the line width without moving the cursor?
The gw operator reformats text just like gq, but leaves the cursor in its original position after reformatting.
category:
editing
tags:
#editing
#formatting
#motions
#text-objects
How do I define autocmds safely so they don't duplicate when my vimrc is re-sourced?
Wrapping autocmds in a named augroup with autocmd! at the start prevents duplicate autocommands from accumulating every time your vimrc is sourced.
category:
config
tags:
#config
#ex-commands
#editing