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.
870 results for "it at"
:undo {N}
:undo {N} lets you jump directly to the undo tree state after change number N was applied.
:g/pattern1/g/pattern2/command
Vim's :g command can be nested — the command part of one :g can itself be another :g.
vim.lsp.enable()
Neovim 0.
:%norm! A;
The :norm! (or :normal!) command executes normal mode keystrokes while ignoring all user-defined mappings.
\@= and \@! and \@<= and \@<!
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@=, \@!, \@<=, and \@<! atoms.
\%V
The \%V atom in a Vim pattern matches only inside the last visual selection.
search #search #visual-mode #substitute #regex #text-objects
[#
Vim includes built-in motions for navigating C preprocessor conditional blocks: [# jumps backward to the previous unmatched #if or #else, and ]# jumps forward t
cs"'
The vim-surround plugin by Tim Pope lets you change any surrounding delimiter pair with a single cs command.
plugins #plugins #surround #editing #text-objects #normal-mode
:set jumpoptions+=stack,view
When you jump around large files with and , the default behavior can feel disorienting because your cursor position may return but your viewport context does no
:debug
The :debug command prefix puts Vim into its built-in interactive debugger before executing the given command.
command-line #ex-commands #debugging #command-line #vimscript
[d
The [d command searches from the beginning of the file for the first line matching the define pattern for the word under the cursor, and displays it in the stat
:windo lcd %:p:h<CR>
When multiple splits point at files from different projects, relative-path commands can become inconsistent and error-prone.
:autocmd FileType python setlocal keywordprg=pydoc3
The K command looks up the word under the cursor using the program defined by keywordprg (default: man).
:'<,'>sort /\%V.*$/
When you need to sort records by a substring that starts at a visual column, Vim can do it without external tools.
visual-mode #visual-mode #sorting #ex-commands #text-processing
:%s/\V<C-r>//gc
When your last search pattern contains punctuation, slashes, or regex atoms, retyping it inside :substitute is error-prone.
<C-u>
The (Ctrl+u) command scrolls the window up by half a screen, moving the cursor along with it.
:undojoin
When writing Vim scripts or running multiple Ex commands, each command normally creates a separate undo entry.
:%s/\(\d\+\)/\=submatch(1)+1/g
Vim's substitute command supports using a VimScript expression as the replacement by prefixing it with \=.
:drop {file}
When the same file is already open elsewhere, using :edit can create extra navigation friction because you stay in the current window and may lose layout contex
buffers-windows #buffers-windows #windows #buffers #workflow
>%
Vim's > operator (indent) works with any motion or text object — including %, which jumps to the bracket, parenthesis, or brace matching the one under the cur
editing #editing #indentation #text-objects #normal-mode #motions