How do I jump directly to a specific point in the undo history by change number?
:undo {N}
:undo {N} lets you jump directly to the undo tree state after change number N was applied.
2277 results for "@a"
:undo {N}
:undo {N} lets you jump directly to the undo tree state after change number N was applied.
: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
z=
When spell checking is enabled, the z= command opens a numbered list of spelling suggestions for the misspelled word under the cursor.
editing #editing #spell-check #normal-mode #productivity #prose
vim: set ts=2 sw=2 et:
Modelines are special comments at the top or bottom of a file that Vim reads to apply file-specific settings.
gw
The gw operator reformats text to fit within textwidth, just like gq — but with one key difference: gw leaves the cursor in its original position after format
:%s/\(prefix\)\@<=target/replacement/g
Vim's \@<= is a zero-width look-behind assertion.
:set completeopt=menuone,noinsert,noselect
When completion inserts text too early, you lose control over what gets committed and where undo breakpoints land.
/\vfoo\zsbar\zebaz
When you need to target only a slice of a larger pattern, \zs and \ze are usually cleaner than building lookarounds.
:keeppatterns {command}
The :keeppatterns modifier runs an Ex command — typically :s, :g, or :v — without modifying @/ (the last search pattern) or the command history.
command-line #ex-commands #search #substitution #command-line #scripting
:Cfilter /pattern/
Vim ships with an optional built-in package called cfilter that adds :Cfilter and :Lfilter commands for narrowing down quickfix and location list entries by pat
:s/\v\w+/\U&/g
Vim's substitute command supports special case-conversion sequences in the replacement string, letting you transform matched text to upper or lower case without
:set diffopt+=algorithm:histogram
Switches Vim's diff algorithm from the default Myers algorithm to histogram, which produces more semantically meaningful diffs by avoiding false matches between
<C-r>:
Vim stores your last executed Ex command in the read-only : register.
:set winwidth=85 winheight=20
Setting winwidth and winheight tells Vim the minimum column width and line height the current focused window must have.
\V
Vim's default search mode gives special meaning to characters like .
nnoremap <key> <Cmd>command<CR>
The special key (Vim 8.
config #config #macros #ex-commands #normal-mode #insert-mode
q:
The command-line window is a special buffer that shows your entire Ex command history and lets you edit entries using the full power of Vim's normal mode before
command-line #command-line #ex-commands #history #editing #productivity
gq{motion}
The gq{motion} operator reformats text to fit within Vim's textwidth setting, inserting hard line breaks where lines are too long.
:[range]join
The :[range]join Ex command lets you join lines by specifying an explicit line range — without having to navigate there or use visual selection.
:%s/pattern/replacement/ig
The :s substitute command accepts /i and /I flags that override your global ignorecase and smartcase settings for that single substitution, letting you choose c