- commit
- 42c97ec
- parent
- 1cf4f3d
- author
- Eric Bower
- date
- 2025-09-21 14:46:11 -0400 EDT
chore(nvim): cqf refinement
1 files changed,
+9,
-4
+9,
-4
1@@ -38,15 +38,19 @@ vim.g.maplocalleader = ","
2 vim.diagnostic.config({
3 severity_sort = true,
4 })
5-require("vim._extui").enable({}) -- https://github.com/neovim/neovim/pull/27855
6
7-local function cqf(cmd)
8+local function cqf(cmd, jump)
9+ jump = jump or false
10 if cmd == nil then
11 return
12 end
13
14 local files = vim.fn.systemlist(cmd)
15- if #files == 1 then
16+ if #files == 0 then
17+ vim.notify("no files found")
18+ return
19+ end
20+ if jump and #files == 1 then
21 vim.cmd(string.format("edit %s", files[1]))
22 return
23 end
24@@ -92,7 +96,7 @@ map("n", "<leader>g", function() -- grep entire project
25 end, opts)
26 map("n", "<leader>s", function() -- fuzzy match files into quickfix
27 vim.ui.input({ prompt = "file: " }, function(file)
28- cqf(string.format("fd -t f | fzf -f %s", file))
29+ cqf(string.format("fd -t f | fzf -f %s", file), true)
30 end)
31 end)
32 map("n", "<leader>d", function() -- git diff into quickfix
33@@ -192,6 +196,7 @@ vim.pack.add({
34 "https://github.com/linrongbin16/gitlinker.nvim",
35 })
36
37+require("vim._extui").enable({}) -- https://github.com/neovim/neovim/pull/27855
38 setup_ts()
39 setup_lsp()
40 require("treesitter-context").setup({ max_lines = 3, separator = ">", mode = "topline" })