How do I make jumps reuse open windows first and fall back to a new tab when needed?
:set switchbuf=useopen,usetab,newtab
When jump commands open files (:tag, quickfix navigation, location list jumps), Vim may split your layout in ways that break flow.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#quickfix
#config
How do I configure :make to run the current file as a script with a specific interpreter?
Setting makeprg to include % lets :make always execute the file you're currently editing.
category:
config
tags:
#config
#makeprg
#workflow
#quickfix
How do I run a shell command from Vimscript and capture its output as a list of individual lines?
systemlist({cmd}) runs a shell command and returns the output as a list of strings, one per line — unlike system() which returns everything as a single string
category:
command-line
tags:
#vimscript
#ex-commands
#registers
#macros
How do I run an interactive replacement across quickfix entries and only save changed files?
:cdo keeppatterns s/\<foo\>/bar/gec | update
When quickfix already contains precise targets, :cdo gives you a safer multi-file replace loop than broad project substitutions.
category:
command-line
tags:
#command-line
#quickfix
#substitute
#refactoring
How do I search a project without overwriting the global quickfix list?
:lvimgrep /pattern/gj **/*.js | lopen
When you already rely on the global quickfix list for compiler errors or another search, running :vimgrep can wipe that context.
category:
search
tags:
#search
#command-line
#quickfix
#navigation
How do I load a pre-built compiler configuration to set makeprg and errorformat together?
The :compiler command loads a compiler plugin from Vim's runtime path, setting both makeprg (the build command) and errorformat (the error parsing pattern) in o
category:
command-line
tags:
#ex-commands
#command-line
How do I append another pattern search to the current quickfix results?
:vimgrepadd /FIXME/j **/*.go
When you are triaging a codebase, one pattern is rarely enough.
category:
search
tags:
#search
#quickfix
#project-workflow
#ex-commands
How do I run a substitution over every quickfix hit and save only changed files?
:cdo s/foo/bar/ge | update
When quickfix already contains exactly the lines you want to touch, :cdo is the safest way to batch-edit with tight scope.
category:
command-line
tags:
#command-line
#quickfix
#substitution
#refactoring
How do I run a literal project-wide vimgrep for the word under my cursor?
:vimgrep /\V<C-r><C-w>/gj **/*
When you need a project-wide search for the exact word under your cursor, this pattern avoids regex surprises and immediately populates quickfix.
category:
search
tags:
#search
#quickfix
#command-line
#project-workflow
How do I run a recorded macro on every file in my argument list at once?
The :argdo command applies any Ex command to every file in the argument list.
category:
macros
tags:
#macros
#ex-commands
#argdo
#normal-mode
#editing
How do I run a command on every individual quickfix entry in Vim?
:cdo {cmd} executes a command at every entry in the quickfix list, visiting each location in turn.
category:
command-line
tags:
#command-line
#ex-commands
#search
#editing
How do I run builds and tests asynchronously without blocking Vim?
The vim-dispatch plugin by Tim Pope provides asynchronous build and command execution so you can run compilers, test suites, and other long-running commands wit
category:
plugins
tags:
#plugins
#dispatch
#async
#build
#testing
#workflow
How do I control windows using Ex commands in scripts and mappings instead of Ctrl-W shortcuts?
:wincmd {key} is the Ex command equivalent of every {key} window shortcut.
category:
buffers-windows
tags:
#buffers-windows
#windows
#ex-commands
#normal-mode
How do I search across multiple files and navigate results without leaving Vim?
:vimgrep /pattern/g **/*.ext
The :vimgrep command searches for a pattern across multiple files and loads the results into the quickfix list.
category:
search
tags:
#search
#multi-file
#quickfix
#grep
#workflow
How do I view the git commit history for the current file in vim-fugitive?
vim-fugitive's :Gclog command loads the git log into the quickfix list, but when prefixed with the range 0 it restricts the history to only the commits that tou
category:
plugins
tags:
#plugins
#git
#fugitive
#quickfix
#buffers
How do I configure Vim's :grep command to use a faster external search tool like ripgrep or ag?
:set grepprg={cmd} grepformat={fmt}
Vim's :grep command delegates to an external tool defined by grepprg, then parses the output according to grepformat to populate the quickfix list.
category:
search
tags:
#search
#ex-commands
#config
#buffers
How do I prompt the user for input in the middle of a mapping or Vimscript function?
The built-in input() function pauses execution, displays a prompt at the bottom of the screen, and returns whatever the user types before pressing Enter.
category:
macros
tags:
#macros
#editing
#ex-commands
#insert-mode
How do I browse through my previous quickfix lists?
Vim remembers up to 10 previous quickfix lists.
category:
buffers-windows
tags:
#buffers
#quickfix
#navigation
#history
How do I use the location list instead of the quickfix list to have per-window grep results?
The location list is a per-window counterpart to the global quickfix list.
category:
buffers-windows
tags:
#buffers-windows
#ex-commands
#search
#navigation
How do I execute a macro on each quickfix match and write files only when changed?
When you already have a precise quickfix list, :cdo is one of the safest ways to run a macro only where it matters.
category:
macros
tags:
#macros
#quickfix
#command-line
#automation