How do I search or substitute only within specific columns of text in Vim?
\%>20c
The \%Nc, \%>Nc, and \%20c — match only after column 20 (i.
795 results for "G"
\%>20c
The \%Nc, \%>Nc, and \%20c — match only after column 20 (i.
<C-]> / <C-t>
The command jumps to the definition of the keyword under the cursor using a tags file, and jumps back.
[q / ]q
The vim-unimpaired plugin by Tim Pope provides bracket-pair mappings for navigating quickfix and location list entries: [q moves to the previous entry and ]q mo
:Inspect
When customizing a colorscheme or debugging unexpected syntax colors, it's difficult to know which highlight group to override.
qaq qa...@aq @a
A recursive macro calls itself at the end of its recording, causing it to repeat indefinitely until a command inside it fails (like a search hitting the end of
:set sessionoptions
The sessionoptions option (abbreviated ssop) is a comma-separated list of flags that determine what :mksession stores in the session file.
buffers-windows #buffers-windows #config #workflow #sessions
<C-v>{motion}$A
In visual block mode, pressing $ makes the right edge of the selection "ragged" — it extends to the real end of each line regardless of length.
q?
Vim provides three command-line history windows accessible from normal mode: q: for Ex commands, q/ for forward searches, and q? for backward searches.
zug
When spell checking is active, pressing zg over a word adds it to your personal word list so Vim stops flagging it.
:find filename
The :find command searches for a file by name across all directories in your path setting and opens it.
buffers-windows #buffers #file-management #navigation #workflow
:cexpr system('grep -rn TODO .')
The :cexpr command evaluates an expression and parses the result as quickfix entries using the current errorformat.
mf and D (in netrw)
Vim's built-in file browser netrw (opened with :Explore or :Ex) supports a full file management workflow beyond simple navigation.
nnoremap <expr> j v:count == 0 ? 'gj' : 'j'
By default, j and k move by physical lines (newline-delimited), which jumps over the entire visual span of a long wrapped line in a single keystroke.
vim.lsp.buf.format()
Neovim's built-in LSP client exposes vim.
:let @a = @/
Vim stores the last search pattern in the special / register (@/).
vim.keymap.del()
vim.
flash.nvim
flash.
zl and zh
When a line is longer than the window width and wrap is off, Vim can display only part of it.
:tabdo
The :tabdo {cmd} command executes an Ex command in each open tab page sequentially, visiting every tab and running the command there.
buffers-windows #tabs #buffers #ex-commands #buffers-windows
:set pumheight=10
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.