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.
92 results for "location list vim"
:lvimgrep /pattern/ %
While :vimgrep populates the global quickfix list, :lvimgrep uses the window-local location list instead.
:lgrep /pattern/ % | lopen
Quickfix is global, but sometimes you want a narrower search workspace tied to one window.
:lgrep {pattern} {files}
The location list is a per-window counterpart to the global quickfix list.
buffers-windows #buffers-windows #ex-commands #search #navigation
:lnext and :lprev
The location list is a per-window alternative to the quickfix list.
:lvimgrep /{pattern}/j ## | lopen
When you need to run focused searches across a curated set of files, the argument list is a strong scope boundary.
:lfdo normal! @q | update
When you already have a curated location list, :lfdo lets you apply a change only to those files instead of touching your whole project.
macros #macros #location-list #refactoring #command-line #normal-mode
:lvimgrepadd /pattern/gj **/*
When investigating a bug or refactor, you often need to gather results from several related patterns before deciding what to edit.
:lvimgrep /pattern/j **/* | lopen
Quickfix is great, but it is global.
:lvimgrep /pattern/j %
When you want a searchable list of matches without leaving your current editing context, :lvimgrep is a strong alternative to regular / navigation.
:ldo {cmd}
Vim maintains two parallel systems for collections of file positions: the quickfix list (global, one per Vim session) and the location list (local to each windo
:call setloclist(0, [], 'r', {'title': 'TODO current file', 'lines': systemlist('rg --vimgrep TODO ' . shellescape(expand('%:p'))), 'efm': '%f:%l:%c:%m'})
For focused review work, a window-local location list is often better than global quickfix.
buffers-windows #buffers #windows #location-list #search #quickfix
:lopen / :lnext / :lprev
The location list is a per-window variant of the quickfix list.
buffers-windows #navigation #quickfix #ex-commands #windows #productivity
:lgetexpr systemlist('rg --vimgrep TODO %') | lopen
When you want search results tied to only the current window, use :lgetexpr instead of :cgetexpr.
buffers-windows #location-list #quickfix #buffers #command-line #search
:packadd cfilter | Lfilter /pattern/
When you already have a populated location list, rerunning the original search just to focus on a subset is slow and disruptive.
:ldo execute 'normal @q'
:ldo runs an Ex command on each entry in the location list — the buffer-local cousin of the quickfix list.
:lvimgrep /TODO/j **/* | lopen
When you are working in split-heavy sessions, global quickfix results can become noisy because every window shares the same list.
:lvimgrep /\<TODO\>/gj **/* | lopen
If you want project-wide search results without polluting the global quickfix list, use a location list.
:lvimgrep /TODO/j **/* | lopen\<CR>
When you are working in multiple windows, quickfix can become noisy because it is shared globally across the editor session.
: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.
[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