How do I temporarily narrow quickfix entries by pattern using the cfilter plugin?
:packadd cfilter | Cfilter /ERROR/
Quickfix lists can get noisy in large projects, especially when one grep or compiler run mixes several classes of issues.
Search Vim Tricks
Searching...:packadd cfilter | Cfilter /ERROR/
Quickfix lists can get noisy in large projects, especially when one grep or compiler run mixes several classes of issues.
:put =getreg('a', 1, 1)
Most register pastes are character-oriented, but advanced edits often need to preserve exact line structure.
registers #registers #ex-commands #scripting #text-processing
:'<,'>normal @@
When you already have a useful macro but need to apply it to a specific block of lines, :'normal @@ is a high-leverage pattern.
gUip
gUip is a compact operator-plus-text-object pattern that uppercases exactly the paragraph your cursor is in.
:vimgrepadd /FIXME/j **/*.go
When you are triaging a codebase, one pattern is rarely enough.
:bufdo if &buftype ==# '' | update | endif
bufdo is powerful for multi-buffer automation, but a naive write pass can error on special buffers (help, terminal, quickfix, prompts).
buffers-windows #buffers #windows #ex-commands #automation #workflow
:set shada='200,<1000,s100,h
Default ShaDa settings are conservative, which can make long-running workflows lose useful context between sessions.
:cdo normal! @q
When a refactor target spans many files but only specific matches matter, running a macro globally is risky.
:keeppatterns %s/\s\+$//e
Bulk cleanup commands often damage your navigation flow by overwriting the last search pattern (@/).
command-line #command-line #search #substitution #whitespace
:'<,'>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
:echo string(getreg('q'))
Macros can fail for subtle reasons: hidden control keys, extra whitespace, or unexpected register contents.
registers #registers #macros #debugging #automation #command-line
:let @q .= "j^"
Live macro recording is fast, but adjusting the tail of a macro by re-recording can be risky once it already works in most places.
macros #macros #registers #automation #normal-mode #workflow
g~ap
g~ap is a fast way to invert letter case across a full paragraph without entering Visual mode.
editing #editing #operators #text-objects #case #normal-mode
''
When you jump around a file, Vim tracks prior locations.
navigation #navigation #motions #marks #jumplist #normal-mode
:history :
When you work with long substitution pipelines or multi-part Ex commands, digging through all history (:history) adds noise.
:packadd matchit<CR>
The default % motion is great for simple delimiters, but many code structures use semantic pairs like if/else/endif, try/catch, or HTML tags.
:wn
:wn (short for :wnext) writes the current buffer to disk and immediately advances to the next file in the argument list.
:set shada
Neovim's ShaDa (Shared Data) file replaces Vim's viminfo and persists session state across restarts — marks, registers, command history, search history, jump
:Gitsigns stage_hunk
gitsigns.
:keepjumps normal! gg=G<CR>
Whole-buffer reindent is common, but doing it naively can pollute your jumplist and break navigation flow during review.