.config/nvim/lua/config/autocmds.lua

changeset 1077
5439ee582f9b
parent 1076
15007f695dfb
child 1078
aa4c1aa529a5
equal deleted inserted replaced
1076:15007f695dfb 1077:5439ee582f9b
68 }) 68 })
69 69
70 -- >> simple highlight conflict markers 70 -- >> simple highlight conflict markers
71 autocmd("BufReadPost", "*", { 71 autocmd("BufReadPost", "*", {
72 callback = function(_) 72 callback = function(_)
73 fn.matchadd("Error", [[^\([<>|]\)\{7} \@=\|^=\{7}$]]) 73 fn.matchadd("Error", [[\m^\([<>|]\)\{7} \@=\|^=\{7}$]])
74 end, 74 end,
75 }) 75 })
76 76
77 -- >> nicer quickfix 77 -- >> nicer quickfix
78 autocmd("BufReadPost", "quickfix", { 78 autocmd("BufReadPost", "quickfix", {
79 callback = function(ctx) 79 callback = function(ctx)
80 -- simplify noisy :ltag output 80 -- simplify noisy :ltag output
81 if string.match(vim.w.quickfix_title, "^ltag") then 81 if string.match(vim.w.quickfix_title, "^ltag") then
82 fn.matchadd("Conceal", [[|\zs\^\\V\|\\$|.*]]) 82 -- Hide ctags regex anchors
83 fn.matchadd("Conceal", [[\m|\zs\^\\V\|\\$\ze|]])
84
85 -- highlight match in line. if tagname begins with / the rest is a \V
86 -- regex. match must be between vertical bars, so its the 2nd column.
87 local tagmatch = string.gsub(vim.fn.gettagstack().items[1].tagname, "^/", "\\V", 1)
88 fn.matchadd("Underlined", [[\m|.*\zs]] .. tagmatch .. [[\m\ze.*|]])
83 end 89 end
84 90
85 -- easy close 91 -- easy close
86 vim.keymap.set("n", "q", "<C-w>q", { buffer = true }) 92 vim.keymap.set("n", "q", "<C-w>q", { buffer = true })
87 end, 93 end,

mercurial