How do I undo the last change in Vim?
u
The u command undoes the last change you made in normal mode.
90 results for "%s/old/new/g"
u
The u command undoes the last change you made in normal mode.
:set inccommand=split
Neovim's inccommand option provides real-time visual feedback as you type substitution commands.
:keepmarks
When Vim executes commands that move or reorder lines — such as :sort, :%!sort, or :s/// across ranges — it automatically adjusts named marks to follow the
:set incsearch hlsearch
The combination of incsearch and hlsearch gives you live, interactive search highlighting.
oil.nvim: edit directory listing like a buffer
oil.
:keepjumps {cmd}
:keepjumps is a command modifier that suppresses any jump list updates caused by the command that follows it.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
:set nowritebackup
By default, Vim saves files using a "write-then-rename" strategy: it writes to a temporary backup file and then renames it over the original.
:g/pattern/command
The :g/pattern/command (global) command executes an Ex command on every line in the file that matches the given pattern.
:noautocmd e {file}
When you have heavy autocmds registered for BufRead, BufEnter, or FileType events — such as LSP clients, formatters, or syntax processors — opening a large
command-line #command-line #ex-commands #buffers-windows #config
5:
Typing a count before : in normal mode automatically fills in a line range in the command line.
command-line #command-line #ex-commands #ranges #normal-mode
:vimgrep /pattern/j **/*
By default, :vimgrep jumps your cursor to the first match it finds, which can be disorienting when you just want to collect results and browse them on your own
<C-q> (Telescope)
While inside any Telescope picker, pressing sends all current results to the quickfix list and closes the picker.
:vimgrep /pattern/ **
:vimgrep /pattern/ searches recursively through all files in the current working directory tree using Vim's own regex engine, populating the quickfix list with
##
The ## special token expands to the names of all files currently in Vim's argument list.
"qp {edit} 0"qy$ dd
When you record a macro and realize it has a mistake, the easiest fix is to paste the macro's keystrokes as text, edit them, and yank the corrected version back
:keeppattern {cmd}
Many Ex commands silently overwrite the search register (@/), which changes your hlsearch highlighting and n/N behavior.
:history :
When you work with long substitution pipelines or multi-part Ex commands, digging through all history (:history) adds noise.
:earlier 5m
Vim's :earlier and :later commands let you travel through your undo history using time-based offsets — not just individual changes.
:cdo s/foo/bar/ge | update
When quickfix already contains exactly the lines you want to touch, :cdo is the safest way to batch-edit with tight scope.
command-line #command-line #quickfix #substitution #refactoring