How do I enable persistent undo so undo history survives closing files?
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
2125 results for "i( a("
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
:filter /pattern/ command
The :filter command restricts the output of another Ex command to only lines matching a given pattern.
+
The + command moves the cursor to the first non-blank character of the next line.
:set hidden
By default, Vim refuses to let you switch away from a buffer that has unsaved changes, forcing you to save or discard with :w or :e! before moving on.
ci(
The ci( command deletes everything inside the nearest pair of parentheses and places you in insert mode, ready to type a replacement.
<C-k>{digraph}
Vim's digraph system lets you insert special characters, accented letters, and symbols by typing a memorable two-character sequence.
gv=gv
When you are iterating on indentation, repeating selection steps is wasted motion.
visual-mode #visual-mode #indentation #editing #formatting #workflow
*Ndgn
When you are reviewing repetitive text, you often need to remove one specific match without running a broad substitute.
:set autoread | autocmd FocusGained * checktime
When working with Git, build tools, or collaborators, files may change outside Vim.
buffers-windows #buffers-windows #autoread #file-detection #external-changes
,
After using f, t, F, or T for single-character motion on a line, Vim lets you repeat that character search without retyping the target.
:set complete+=kspell
Vim's built-in completion ( / ) sources matches from buffers, included files, and tags by default.
/\vstart\_.{-}end
Multiline searches in Vim often overmatch because .
:%sort u
The :sort u command sorts all lines in the file and removes duplicate lines in one operation.
command-line #command-line #ex-commands #editing #text-manipulation #sort
:setlocal winfixheight
Quickfix windows are easy to disturb when you open, close, or rebalance other splits.
g~iw
The g~iw command toggles the case of every character in the word under the cursor — uppercase letters become lowercase and vice versa.
:set wrapscan!
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
:lockmarks keepjumps keeppatterns %s/\s\+$//e
Bulk cleanup commands are easy to automate, but many implementations quietly damage editor state by moving marks, polluting the jumplist, or replacing your last
vim.tbl_deep_extend('force', defaults, overrides)
vim.
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
:checkpath!
:checkpath! recursively walks through every file reachable via Vim's include path and displays the full include tree.