How do I use \zs to set the start of a search match so only part of the pattern is highlighted or operated on?
/prefix\zsword
Vim's \zs atom marks the start of the match within a longer pattern.
795 results for "g* g#"
/prefix\zsword
Vim's \zs atom marks the start of the match within a longer pattern.
:digraphs
:digraphs (abbreviated :dig) displays a full reference table of every digraph registered in Vim.
command-line #editing #special-characters #insert-mode #command-line
m'
Vim's jump list automatically records your position whenever you make large motions (like G, /pattern, or ).
:mkview / :loadview
:mkview saves a snapshot of the current window — its fold states, cursor position, and local option values — to a view file on disk.
buffers-windows #folding #buffers-windows #config #ex-commands
dv{motion}
In operator-pending mode — after typing an operator like d, y, or c but before the motion — you can press v, V, or to override the motion type to characterw
<C-v>u{hex}
In insert mode, pressing followed by u and a 4-digit hexadecimal codepoint inserts the corresponding Unicode character directly into the buffer.
\%V (in search/substitute pattern)
The \%V atom in a Vim pattern matches only inside the last visual selection.
search #search #visual-mode #substitution #regex #normal-mode
set complete=.,w,b,u,t
The complete option controls which sources Vim scans when you press or for generic keyword completion.
set foldlevelstart=N
When Vim opens a file with folds enabled, it uses the foldlevelstart option to decide how many fold levels to open automatically.
:lockmarks keepjumps keeppatterns %s/foo/bar/ge
Large substitutions are efficient, but they often leave side effects: your last search changes, your jumplist gets noisy, and marks can shift in ways that break
command-line #command-line #editing #substitution #navigation
". / "% / ": / "# registers
Vim has four read-only special registers that automatically contain useful contextual information.
registers #registers #special-registers #workflow #productivity
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
set smoothscroll
By default, Neovim's half-page scroll commands (, , , ) count movement by text lines, not screen rows.
:checkhealth {module}
:checkhealth {module} runs the health check only for the specified module, making it much faster than the full :checkhealth which interrogates every registered
command-line #neovim #diagnostics #debugging #plugins #health
zs and ze
When nowrap is set and lines extend beyond the screen width, zs and ze snap the horizontal scroll position so the cursor sits exactly at the left or right edge
:'<,'>norm .
The :'norm .
visual-mode #visual-mode #editing #normal-mode #repeat #dot-operator
ftdetect/{filetype}.vim
Vim automatically sources every file in ftdetect/ directories on the runtimepath when filetype detection runs.
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
gwip
The gw operator reformats text just like gq, but leaves the cursor in its original position after reformatting.
mA
Uppercase marks (A–Z) are global marks in Vim — they persist across files and even across sessions (when viminfo or shada is configured).