Summary Files Commits Branches @commit @diff @stats
path: root / lua
diff options
context:
space:
mode:
Commit3902eab99b8128e829629c2aeefcbe6ecb8c938d (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-31 21:12:45 +0300
Committer
 Syndamia <kamen@syndamia.com>
2026-03-31 21:12:45 +0300
Files9c115309e9059e8bb2ad99a5e1f571db5f45ff78 /lua
anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.tar
anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.tar.gz
anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.zip
Parentbbfecdd3ac17fa35a72e4ba5427aece438f196f1 (diff)
feat(ux): Change formatting of quickfix list
1 files changed, 26 insertions, 0 deletions
-rw-r--r--lua/ux.lua26
diff --git a/lua/ux.lua b/lua/ux.lua
index c391129..11f78e4 100644
--- a/lua/ux.lua
+++ b/lua/ux.lua
@@ -37,3 +37,29 @@ vim.o.timeoutlen = 350
vim.o.undofile = true
vim.o.undodir = vim.fn.expand("~/nvim/undo")
+
+--[=[ Quickfix ]=]--
+
+vim.cmd [[
+ function QuickFixFormat(info)
+ let qfl = []
+
+ let maxfnlen = 0
+ let maxlilen = 0
+ for d in getqflist()
+ let maxfnlen = max([maxfnlen, strdisplaywidth(fnamemodify(bufname(d.bufnr), ":t"))])
+ let maxlilen = max([maxlilen, strdisplaywidth(string(d.lnum))])
+ endfor
+ let strfmt = "%-" . maxfnlen . "s |%". maxlilen ."d|%s"
+
+ let lastfile = ""
+ for d in getqflist()
+ let fn = fnamemodify(bufname(d.bufnr), ":t")
+ call add(qfl, printf(strfmt, fn == lastfile ? '' : fn, d.lnum, d.text))
+ let lastfile = fn
+ endfor
+ return qfl
+ endfunction
+]]
+
+vim.o.quickfixtextfunc = "QuickFixFormat"