What
Add a :QfFilter {pattern} user command that filters the current quickfix list in-place, keeping only entries whose message text or filename matches a Lua pattern.
Where
lua/config/options.lua — alongside the existing :Compile command and <leader>co/cc keymaps (around lines 159–169).
Why it matters
The config uses quickfix heavily: :Compile populates it with build or grep output, and <leader>co/cc open/close it. After a large make run or wide vimgrep, the list can contain hundreds of entries. There is no built-in way to narrow it without re-running the original command with a tighter query.
Example use cases:
:QfFilter error — keep only lines containing "error" after a build
:QfFilter foo%.c — keep only entries from foo.c
:QfFilter undefined — isolate one class of linker error from a noisy build
The <leader>cf keymap (mnemonic: close/clear → clean/filter) could be a natural extension point, but the command alone is already useful via cmdline completion.
Recommended action
Add to lua/config/options.lua:
vim.api.nvim_create_user_command("QfFilter", function(opts)
local pattern = opts.args
local items = vim.fn.getqflist()
local filtered = vim.tbl_filter(function(item)
local text = item.text or ""
local fname = vim.fn.bufname(item.bufnr) or ""
return text:find(pattern) ~= nil or fname:find(pattern) ~= nil
end, items)
vim.fn.setqflist(filtered, "r")
if #filtered > 0 then
vim.cmd("copen")
else
vim.notify("QfFilter: no entries match " .. vim.inspect(pattern), vim.log.levels.WARN)
end
end, { nargs = 1, desc = "Filter quickfix list by Lua pattern" })
A companion :QfRestore that reverts to the last unfiltered list (stored in a module-level variable) would round out the feature.
What
Add a
:QfFilter {pattern}user command that filters the current quickfix list in-place, keeping only entries whose message text or filename matches a Lua pattern.Where
lua/config/options.lua— alongside the existing:Compilecommand and<leader>co/cckeymaps (around lines 159–169).Why it matters
The config uses quickfix heavily:
:Compilepopulates it with build or grep output, and<leader>co/ccopen/close it. After a largemakerun or widevimgrep, the list can contain hundreds of entries. There is no built-in way to narrow it without re-running the original command with a tighter query.Example use cases:
:QfFilter error— keep only lines containing "error" after a build:QfFilter foo%.c— keep only entries fromfoo.c:QfFilter undefined— isolate one class of linker error from a noisy buildThe
<leader>cfkeymap (mnemonic: close/clear → clean/filter) could be a natural extension point, but the command alone is already useful via cmdline completion.Recommended action
Add to
lua/config/options.lua:A companion
:QfRestorethat reverts to the last unfiltered list (stored in a module-level variable) would round out the feature.