How do I search across files using the location list instead of quickfix?
:lvimgrep /pattern/ %
While :vimgrep populates the global quickfix list, :lvimgrep uses the window-local location list instead.
49 results for ":cdo"
:lvimgrep /pattern/ %
While :vimgrep populates the global quickfix list, :lvimgrep uses the window-local location list instead.
:vimgrepadd /pattern/j **/*<CR>
When you are investigating code, you often need to collect several related patterns before deciding what to edit.
\u / \l / \U / \L (in :s replacement)
Vim's :substitute replacement string supports case-conversion modifiers that let you uppercase or lowercase matched text without writing a separate command.
:normal! @q
Recorded macros can become fragile when your config defines mappings that shadow built-in keys.
:cexpr system('rg --vimgrep "TODO"')
When you already know you want an external search tool, :cexpr lets you import results directly into quickfix without opening a terminal buffer or shelling out
:vimgrep /\<TODO\>/gj **/*.lua | copen
When you want a project-wide TODO pass without leaving Vim, :vimgrep plus quickfix is a strong built-in workflow.
search #search #quickfix #command-line #project-navigation #ex-commands
: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.
:cnext
The quickfix list is Vim's built-in way to collect a list of positions — typically compiler errors, grep results, or linter warnings — and jump between them
:vimgrep /pattern/ %
When you need to find all occurrences of a pattern in the current file and jump between them systematically, :vimgrep with % is more powerful than basic / searc
:argdo norm @a | update
Combining :argdo with :norm @a lets you apply a recorded macro to every file in Vim's argument list — a powerful pattern for bulk refactoring across a project
: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.
:vimgrep /{pattern}/j **/*
For project-wide searches, :vimgrep is powerful but can feel disruptive if it jumps into files while populating quickfix.
:ldo s/foo/bar/ge | update\<CR>
:ldo is one of the most effective ways to perform targeted, multi-file edits without touching unrelated text.
:update
The :update command (abbreviated :up) writes the buffer to disk only if it has been modified since the last save.
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
macros #macros #batch-editing #multi-file #ex-commands #workflow
:vimgrep /pattern/j **/*
By default, :vimgrep jumps your cursor to the first match it finds, which can be disorienting when you just want to collect results and browse them on your own
:vimgrep // **/*.txt
Using // (an empty pattern) in :vimgrep tells Vim to reuse the last search pattern.
require('telescope.builtin').grep_string()
Telescope's grepstring() function performs a project-wide search for the exact word currently under the cursor, displaying live-previewed results in an interact
:vimgrep /pattern/g **/*.ext
The :vimgrep command searches for a pattern across multiple files and loads the results into the quickfix list.
:'<,'>normal! .
When you already made one correct edit, replaying it is usually safer than retyping it by hand.