.config/nvim/after/ftplugin/qf.lua

changeset 1091
f407eccdaf61
parent 1082
098f661195c1
child 1101
40419d8e3cbb
equal deleted inserted replaced
1090:a9da52816a33 1091:f407eccdaf61
3 local wininfo = fn.getwininfo(fn.win_getid())[1] or {} 3 local wininfo = fn.getwininfo(fn.win_getid())[1] or {}
4 local is_loc = wininfo.loclist == 1 4 local is_loc = wininfo.loclist == 1
5 local qftitle = wininfo.variables.quickfix_title 5 local qftitle = wininfo.variables.quickfix_title
6 6
7 vim.bo.buflisted = false 7 vim.bo.buflisted = false
8 vim.wo.conceallevel = 2
8 vim.wo.concealcursor = "n" 9 vim.wo.concealcursor = "n"
9 vim.wo.wrap = false 10 vim.wo.wrap = false
10 11
11 -- easy close 12 -- easy close
12 vim.keymap.set("n", "q", "<C-w>q", { buffer = true }) 13 vim.keymap.set("n", "q", "<C-w>q", { buffer = true })
13 14
14 if is_loc then 15 if is_loc then
15 -- simplify noisy :ltag output 16 -- simplify noisy :ltag output
16 if qftitle and string.match(qftitle, "^ltag") then 17 if qftitle and string.match(qftitle, "^ltag") then
17 -- Hide ctags regex anchors 18 -- Hide ctags regex anchors
18 fn.matchadd("Conceal", [[\m|\zs\^\\V\|\\$\ze|]]) 19 fn.matchadd("Conceal", [[|\zs\^\\V\|\\$\ze|]])
19 20
20 -- Hide lsp tagfunc line/col seek references 21 -- Hide lsp tagfunc line/col seek references
21 fn.matchadd("Conceal", [[\m|\zs\\Vcall cursor(\|)\ze|]]) 22 fn.matchadd("Conceal", [[|\zs\\V\\%\|c\ze|]])
23 fn.matchadd("Conceal", [[|\\V\\%\d\+\zsl\\%]], 10, -1, {conceal = ","})
22 24
23 -- highlight match in line. if tagname begins with / the rest is a \v 25 -- highlight match in line. if tagname begins with / the rest is a \v
24 -- regex. match must be between vertical bars, so its the 2nd column. 26 -- regex. match must be between vertical bars, so its the 2nd column.
25 local tagstack = fn.gettagstack() 27 local tagstack = fn.gettagstack()
26 if tagstack then 28 if tagstack then

mercurial