diff options
| Commit | 3902eab99b8128e829629c2aeefcbe6ecb8c938d (patch) | |
|---|---|---|
| Author | 2026-03-31 21:12:45 +0300 | |
| Committer | 2026-03-31 21:12:45 +0300 | |
| Files | 9c115309e9059e8bb2ad99a5e1f571db5f45ff78 /lua/ux.lua | |
| anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.tar anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.tar.gz anderson-3902eab99b8128e829629c2aeefcbe6ecb8c938d.zip | ||
| Parent | bbfecdd3ac17fa35a72e4ba5427aece438f196f1 (diff) | |
feat(ux): Change formatting of quickfix list
1 files changed, 26 insertions, 0 deletions
| -rw-r--r-- | lua/ux.lua | 26 |
@@ -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" |
