- commit
- 78cbe88
- parent
- e0ad93c
- author
- Eric Bower
- date
- 2025-10-17 22:39:42 -0400 EDT
refactor(nvim): remove nvim-treesitter refactor(nvim): move qf util code to github.com/neurosnap/qfutil.nvim
3 files changed,
+17,
-142
+12,
-3
1@@ -1,9 +1,9 @@
2-[gpg]
3- program = gpg2
4 [user]
5 signingkey = 7A51A47D76D3FD02
6 name = Eric Bower
7 email = me@erock.io
8+[gpg]
9+ program = gpg2
10 [pull]
11 rebase = true
12 [sendemail]
13@@ -16,9 +16,18 @@
14 defaultBranch = main
15 [diff]
16 renames = true
17- tool = vimdiff
18 [format]
19 useAutoBase = whenAble
20+[core]
21+ pager = delta
22+[interactive]
23+ diffFilter = delta --color-only
24+[delta]
25+ navigate = true # use n and N to move between diff sections
26+ side-by-side = true
27+ dark = true
28+[merge]
29+ conflictStyle = zdiff3
30 [alias]
31 u = remote update --prune
32 a = add -A
+2,
-2
1@@ -1,6 +1,6 @@
2 fish_config theme choose "dracula"
3
4-fish_add_path ~/.deno/bin ~/.yarn/bin ~/go/bin ~/.npm-packages/bin ~/bin /usr/local/go/bin ~/.cargo/bin ~/neovim/bin
5+fish_add_path ~/.deno/bin ~/.yarn/bin ~/go/bin ~/.npm-packages/bin ~/bin /usr/local/go/bin ~/.cargo/bin ~/neovim/bin ~/.local/bin
6
7 switch (uname)
8 case Darwin
9@@ -38,7 +38,7 @@ abbr -a gpt "llama-server -hf unsloth/gpt-oss-20b-GGUF:Q4_K_M -ngl 15 --host 0.0
10 abbr -a code "llama-server -hf unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_XL -ngl 15 --host 0.0.0.0 --jinja --threads -1 --ctx-size 32000 --temp 0.7 --min-p 0.0 --top-p 0.80 --top-k 20 --repeat-penalty 1.05 --context-shift"
11 abbr -a zmount zfs mount -a
12 abbr -a keys "keychain --eval --quiet --agents ssh,gpg ~/.ssh/id_ed25519 76D3FD02 | source"
13-abbr -a mdf uvx --with=mdformat-gfm --with=mdformat-frontmatter mdformat --wrap 80
14+abbr -a mdfmt uvx --with=mdformat-gfm --with=mdformat-frontmatter mdformat
15 abbr -a sm sudo systemctl
16 abbr -a smu systemctl --user
17 abbr -a jm sudo journalctl
+3,
-137
1@@ -11,7 +11,6 @@
2 - plugins must be integral to workflow
3 ]]
4 local vim = vim -- suppress lsp warnings
5-local cqf, toggle_qf
6 local o = vim.opt
7 o.tabstop = 2
8 o.shiftwidth = 2
9@@ -69,7 +68,7 @@ map("n", "<leader>r", function()
10 end
11 end, opts)
12 map("n", "<leader>q", function()
13- toggle_qf() -- toggle quickfix
14+ require("qfutil").toggle_qf() -- toggle quickfix
15 end, opts)
16 map("n", "<leader>g", function() -- grep entire project
17 vim.ui.input({ prompt = "grep: " }, function(search)
18@@ -100,10 +99,7 @@ autocmd("Filetype", { group = augroup, pattern = { "make" }, command = "setlocal
19
20 local function setup_lsp()
21 vim.lsp.enable({
22- "cssls", -- npm i -g vscode-langservers-extracted
23 "gopls", -- os package mgr: gopls
24- "html",
25- "jsonls",
26 "lua_ls", -- os package mgr: lua-language-server
27 "pyright", -- npm i -g pyright
28 "ts_ls", -- npm i -g typescript typescript-language-server
29@@ -125,146 +121,16 @@ local function setup_lsp()
30 })
31 end
32
33-local function setup_ts()
34- local ts_parsers = {
35- "bash",
36- "c",
37- "dockerfile",
38- "fish",
39- "git_config",
40- "git_rebase",
41- "gitattributes",
42- "gitcommit",
43- "gitignore",
44- "go",
45- "gomod",
46- "gosum",
47- "html",
48- "javascript",
49- "json",
50- "lua",
51- "make",
52- "markdown",
53- "python",
54- "sql",
55- "toml",
56- "tsx",
57- "typescript",
58- "yaml",
59- "zig",
60- }
61- local nts = require("nvim-treesitter")
62- nts.install(ts_parsers)
63- autocmd("PackChanged", { -- update treesitter parsers/queries with plugin updates
64- group = augroup,
65- callback = function(ev)
66- local spec = ev.data.spec
67- if spec and spec.name == "nvim-treesitter" and ev.data.kind == "update" then
68- vim.schedule(function()
69- nts.update()
70- end)
71- end
72- end,
73- })
74- autocmd("FileType", { -- enable treesitter highlighting and indents
75- group = augroup,
76- callback = function(ev)
77- local filetype = ev.match
78- local lang = vim.treesitter.language.get_lang(filetype)
79- if vim.treesitter.language.add(lang) then
80- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
81- vim.treesitter.start()
82- end
83- end,
84- })
85-end
86-
87 vim.pack.add({
88- { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
89- "https://github.com/nvim-treesitter/nvim-treesitter-context",
90 "https://github.com/neovim/nvim-lspconfig",
91 "https://github.com/tpope/vim-fugitive",
92 "https://github.com/karb94/neoscroll.nvim",
93 "https://github.com/linrongbin16/gitlinker.nvim",
94+ "https://github.com/neurosnap/qfutil.nvim",
95 })
96
97 require("vim._extui").enable({}) -- https://github.com/neovim/neovim/pull/27855
98-setup_ts()
99 setup_lsp()
100-require("treesitter-context").setup({ max_lines = 3, separator = ">", mode = "topline" })
101 require("neoscroll").setup({ duration_multiplier = 0.3 })
102 require("gitlinker").setup()
103-
104-vim.api.nvim_create_user_command("Qfa", function(props)
105- cqf({ cmd = props.args, auto_jump = true })
106-end, { nargs = "+", desc = "convert system command to quickfix and auto jump to first result" })
107-
108-vim.api.nvim_create_user_command("Qf", function(props)
109- cqf({ cmd = props.args, auto_jump = false })
110-end, { nargs = "+", desc = "convert system command to quickfix" })
111-
112-local function cqf_fmt(line)
113- local path, rest = line:match("(%S+)%s*(.*)")
114- if path then
115- if #rest == 0 then
116- rest = path
117- end
118- return string.format("%s:1:1:%s", path, rest)
119- end
120- return ""
121-end
122-
123----Attempts to convert a command that returns a list of filepaths into a quickfix.
124----It assumes the filepaths are in the first column without spaces.
125----@param cmd string The system command to run
126----@param auto_jump boolean Should we navigate to first entry?
127----@param fmt function callback for each line to transform list into errorformat
128-function cqf(args)
129- local jump = args.auto_jump or false
130- local cmd = args.cmd
131- if cmd == nil then
132- return
133- end
134- local efm = "%f:%l:%c:%m"
135- local fmt = args.fmt or cqf_fmt
136-
137- local lines = vim.fn.systemlist(cmd)
138- local fz = {}
139- for _, line in ipairs(lines) do
140- local ln = fmt(line)
141- if #ln > 0 then
142- table.insert(fz, ln)
143- end
144- end
145-
146- if #fz == 0 then
147- vim.notify("no files found: " .. cmd)
148- return
149- end
150-
151- if jump then
152- vim.cmd(string.format("edit %s", lines[1]))
153- end
154-
155- vim.fn.setqflist({}, "r", {
156- title = cmd,
157- lines = fz,
158- efm = efm,
159- })
160-
161- if #fz > 1 then
162- vim.cmd("copen")
163- end
164-end
165-
166--- A simple toggle for quickfix.
167--- Designed to be set to a shortcut.
168-function toggle_qf()
169- for _, win in ipairs(vim.fn.getwininfo()) do
170- if win.quickfix == 1 then
171- vim.cmd("cclose")
172- return
173- end
174- end
175- vim.cmd("copen")
176-end
177+require("qfutil").setup()