How do I jump to the opening or closing brace of the block surrounding my cursor?
[{ and ]}
The [{ motion jumps to the previous unmatched { — the opening brace of the block enclosing your cursor.
2125 results for "i' a'"
[{ and ]}
The [{ motion jumps to the previous unmatched { — the opening brace of the block enclosing your cursor.
cs'"
The vim-surround plugin (by Tim Pope) adds three powerful operators for working with surrounding delimiters — quotes, brackets, parentheses, and HTML tags.
guu / gUU
Vim's case operators gu (lowercase) and gU (uppercase) follow the same doubling convention as dd and yy: repeating the operator letter applies it to the whole c
:call histdel(':', -1)
When you run sensitive or noisy Ex commands, they stay in command history and can be recalled accidentally.
:s/\v(\w+) (\w+)/\2 \1/
Vim's substitute command supports capture groups using \( and \) (or ( and ) in \v very-magic mode).
:packadd! matchit
Vim's % command jumps between matching brackets by default.
plugins #navigation #plugins #text-objects #matching #normal-mode
:%s/\s\+$//
The :%s/\s\+$// command removes trailing whitespace (spaces and tabs) from every line in the file.
[<Space> and ]<Space>
vim-unimpaired (by Tim Pope) provides paired bracket mappings for dozens of common operations.
".p
The ".
registers #registers #editing #insert-mode #normal-mode #productivity
:keepalt edit {file}<CR>
The alternate-file mark (#) powers fast toggles like and commands that depend on the previous file context.
command-line #command-line #buffers #workflow #navigation #advanced
/\v<(TODO|FIXME|BUG)>
When you triage code, jumping among TODO, FIXME, and BUG markers quickly is often more useful than searching each token separately.
:args **/*.py | argdo %s/old/new/gc | update
Vim can perform search-and-replace across multiple files without any plugins by combining the arglist with :argdo.
search #search #substitution #ex-commands #productivity #quickfix #arglist
:windo {cmd}
:windo {cmd} executes an Ex command in every window in the current tab page, cycling through each one and applying the command before returning focus to the ori
buffers-windows #windows #buffers #ex-commands #buffers-windows
X
The X command deletes the character to the left of the cursor (before it).
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
:bnext
The :bnext (or :bn for short) command switches to the next buffer in Vim's buffer list.
:packadd {package}
Vim ships with several useful packages in its opt/ directory that are not loaded by default.
:set diffopt+=iwhite
When comparing files in Vim's diff mode, whitespace-only changes (extra spaces, changed indentation) can clutter the diff and hide meaningful edits.
>%
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
vim.diagnostic.config({virtual_lines = true})
Neovim 0.