Tue, 14 Mar 2023 22:56:37 -0500
try to fix stopinsert/autowrite again
1082
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
1 | local fn = vim.fn |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
2 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
3 | local wininfo = fn.getwininfo(fn.win_getid())[1] or {} |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
4 | local is_loc = wininfo.loclist == 1 |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
5 | local qftitle = wininfo.variables.quickfix_title |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
6 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
7 | vim.bo.buflisted = false |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
8 | vim.wo.concealcursor = "n" |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
9 | vim.wo.wrap = false |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
10 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
11 | -- easy close |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
12 | vim.keymap.set("n", "q", "<C-w>q", { buffer = true }) |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
13 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
14 | if is_loc then |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
15 | -- simplify noisy :ltag output |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
16 | if qftitle and string.match(qftitle, "^ltag") then |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
17 | -- Hide ctags regex anchors |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
18 | fn.matchadd("Conceal", [[\m|\zs\^\\V\|\\$\ze|]]) |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
19 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
20 | -- Hide lsp tagfunc line/col seek references |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
21 | fn.matchadd("Conceal", [[\m|\zs\\Vcall cursor(\|)\ze|]]) |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
22 | |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
23 | -- highlight match in line. if tagname begins with / the rest is a \v |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
24 | -- regex. match must be between vertical bars, so its the 2nd column. |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
25 | local tagstack = fn.gettagstack() |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
26 | if tagstack then |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
27 | local tagmatch = string.gsub(tagstack.items[1].tagname, "^/", "\\v", 1) |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
28 | fn.matchadd("Underlined", [[\m|.*\zs]] .. tagmatch .. [[\m\ze.*|]]) |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
29 | end |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
30 | end |
098f661195c1
move quickfix tweaks to after/ftplugin
Meredith Howard <mhoward@roomag.org>
parents:
diff
changeset
|
31 | end |