48 |
48 |
49 -- >> simple highlight conflict markers |
49 -- >> simple highlight conflict markers |
50 autocmd(g, "BufReadPost", "*", function() |
50 autocmd(g, "BufReadPost", "*", function() |
51 fn.matchadd("Error", [[\m^\([<>|]\)\{7} \@=\|^=\{7}$]]) |
51 fn.matchadd("Error", [[\m^\([<>|]\)\{7} \@=\|^=\{7}$]]) |
52 end) |
52 end) |
53 |
|
54 -- >> nicer quickfix |
|
55 autocmd(g, "BufReadPost", "quickfix", { |
|
56 callback = function(ctx) |
|
57 -- simplify noisy :ltag output |
|
58 if string.match(vim.w.quickfix_title, "^ltag") then |
|
59 -- Hide ctags regex anchors |
|
60 fn.matchadd("Conceal", [[\m|\zs\^\\V\|\\$\ze|]]) |
|
61 |
|
62 -- highlight match in line. if tagname begins with / the rest is a \v |
|
63 -- regex. match must be between vertical bars, so its the 2nd column. |
|
64 local tagmatch = string.gsub(vim.fn.gettagstack().items[1].tagname, "^/", "\\v", 1) |
|
65 fn.matchadd("Underlined", [[\m|.*\zs]] .. tagmatch .. [[\m\ze.*|]]) |
|
66 end |
|
67 |
|
68 -- easy close |
|
69 vim.keymap.set("n", "q", "<C-w>q", { buffer = true }) |
|
70 end, |
|
71 }) |
|