How do I prepend a custom persistent undo directory while keeping existing undodir paths in Vim?
:set undodir^=$HOME/.vim/undo//
If you already have an undodir configured by a distro config or plugin, replacing it outright can remove fallback paths you still want.
category:
config
tags:
#config
#undo-redo
#options
#ex-commands
How do I keep file ownership and metadata stable when Vim writes through symlinks?
When Vim saves a file, it may use a rename-style write strategy that can replace the original inode.
category:
config
tags:
#config
#files
#write
#options
How do I make Vim equalize split windows only horizontally?
If you use many splits, automatic equalization can feel disruptive when Vim resizes both height and width after layout changes.
category:
buffers-windows
tags:
#buffers
#windows
#layout
#options
How do I toggle whether / and ? searches wrap around the file?
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
category:
search
tags:
#search
#options
#command-line
#navigation
How do I make Vim completion menu appear without auto-inserting a candidate?
:set completeopt=menuone,noinsert,noselect
When completion inserts text too early, you lose control over what gets committed and where undo breakpoints land.
category:
config
tags:
#config
#completion
#insert-mode
#options
How do I hide noisy completion messages in Vim's command line?
Insert-mode completion can spam the command line with status text like "match 1 of N" and related prompts.
category:
config
tags:
#config
#completion
#command-line
#options
#insert-mode
How do I make Vim diff produce cleaner hunks and avoid hidden buffer errors?
:set diffopt+=algorithm:histogram,hiddenoff
Default diff behavior is fine for small changes, but larger refactors often produce noisy hunks and annoying warnings about hidden buffers.
category:
config
tags:
#config
#diff
#workflow
#options
How do I change the key that opens Vim's command-line window?
Vim's command-line window is invaluable for editing long : commands, search patterns, and complex substitutions with normal-mode tools.
category:
config
tags:
#config
#command-line
#options
#workflow
How do I make Vim sessions save global variables?
:set sessionoptions+=globals
By default, :mksession restores windows, buffers, and many editor states, but it skips most global variables.
category:
config
tags:
#config
#sessions
#options
#workflow
How do I control what state gets saved when I use :mkview to snapshot a window?
:set viewoptions=cursor,folds,slash,unix
The viewoptions setting is a comma-separated list that determines exactly what :mkview (and the auto-save view pattern) stores in a view file.
category:
config
tags:
#config
#folding
#views
#options
#ex-commands
How do I set window-local and buffer-local options correctly in Neovim Lua config using vim.wo and vim.bo?
vim.wo.number = true / vim.bo.tabstop = 2
Neovim's Lua API exposes three namespaces for setting options with the correct scope: vim.
category:
config
tags:
#neovim
#lua
#config
#options
How do I set Vim options from a Lua config in Neovim using vim.opt?
Neovim's vim.
category:
config
tags:
#config
#neovim
#lua
#options
#editing
How do I make Vim reuse an already-open window or tab when jumping to a quickfix entry?
:set switchbuf=useopen,usetab
By default, Vim opens a new window (or reloads the buffer in the current window) whenever you navigate to a quickfix entry, tag, or :buffer command — even if
category:
buffers-windows
tags:
#buffers-windows
#quickfix
#options
#config
How do I change an option's global default without affecting the current buffer's local value?
Vim maintains two values for most options: a global default that applies to new windows and buffers, and a local copy that can be overridden per-buffer or per-w
category:
config
tags:
#config
#ex-commands
#options
How do I suppress Vim's startup splash screen and reduce noisy status messages?
The shortmess option is a string of single-character flags that tell Vim which messages to suppress or abbreviate.
category:
config
tags:
#config
#messages
#startup
#options
How do I reset a Vim option back to its compiled default value?
Append & to any :set command to reset that option to its compiled-in default value — the value Vim shipped with before any vimrc or plugin changed it.
category:
config
tags:
#config
#options
#debugging
How do I add or remove individual values from a comma-separated Vim option using Neovim Lua?
vim.opt.option:append(value)
Neovim's vim.
category:
config
tags:
#config
#neovim
#lua
#options
How do I toggle a boolean Vim option on and off without typing the full :set option or :set nooption each time?
For any boolean option, appending ! to :set inverts its current value.
category:
config
tags:
#config
#options
#vimrc
#editing
How do I make Vim's search stop at the end of the file instead of wrapping back to the top?
By default Vim's wrapscan option is enabled, which causes / and ? searches to wrap silently from the end of the file back to the beginning (and vice versa).
category:
config
tags:
#search
#config
#options
How do I quickly toggle options and navigate lists using bracket mappings in Vim?
The vim-unimpaired plugin by Tim Pope provides a consistent set of bracket-based mappings for toggling Vim options, navigating paired lists, and performing comm
category:
plugins
tags:
#plugins
#unimpaired
#navigation
#options
#workflow