Mon, 26 Aug 2024 14:23:43 -0500
more gopls config. add inlay hint toggle
1016 | 1 | vim.diagnostic.config({ |
1099
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
2 | float = { |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
3 | close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
4 | focusable = false, |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
5 | header = "", |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
6 | max_width = 72, |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
7 | source = "if_many", |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
8 | style = "minimal", |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
9 | }, |
1032
b0497894f69b
Customize LSP float diags further
Meredith Howard <mhoward@roomag.org>
parents:
1031
diff
changeset
|
10 | severity_sort = true, |
1099
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
11 | underline = true, |
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
12 | virtual_text = false, |
1030
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
13 | }) |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
14 | |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
15 | -- Some options are more chill in text mode, this unchills them if a LSP is in |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
16 | -- play. Note they're global |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
17 | vim.api.nvim_create_autocmd("LspAttach", { |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
18 | once = true, |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
19 | group = "lsp_attach", |
1166
34bf03fa07e4
normalize config.util.autocmd
Meredith Howard <mhoward@roomag.org>
parents:
1163
diff
changeset
|
20 | callback = function(_) |
1030
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
21 | vim.opt.number = true |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
22 | vim.opt.updatetime = 250 |
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
23 | end, |
1016 | 24 | }) |
25 | ||
26 | vim.api.nvim_create_autocmd("LspAttach", { | |
1030
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
27 | group = "lsp_attach", |
1016 | 28 | callback = function(args) |
1032
b0497894f69b
Customize LSP float diags further
Meredith Howard <mhoward@roomag.org>
parents:
1031
diff
changeset
|
29 | vim.api.nvim_create_autocmd("CursorHold", { |
1064 | 30 | group = vim.api.nvim_create_augroup("lsp_buf_diags", { clear = true }), |
1099
28f3c3900576
clean up diagnostic behavior
Meredith Howard <mhoward@roomag.org>
parents:
1083
diff
changeset
|
31 | buffer = args.buf, |
1166
34bf03fa07e4
normalize config.util.autocmd
Meredith Howard <mhoward@roomag.org>
parents:
1163
diff
changeset
|
32 | callback = function(_) vim.diagnostic.open_float() end, |
1030
03d507b3c122
Customize LSP more - diag behavior and symbol HL
Meredith Howard <mhoward@roomag.org>
parents:
1022
diff
changeset
|
33 | }) |
1064 | 34 | end, |
1016 | 35 | }) |