.config/nvim/lua/config/lsp.lua

changeset 1166
34bf03fa07e4
parent 1163
40367220022e
equal deleted inserted replaced
1165:840f0fde07e2 1166:34bf03fa07e4
15 -- Some options are more chill in text mode, this unchills them if a LSP is in 15 -- Some options are more chill in text mode, this unchills them if a LSP is in
16 -- play. Note they're global 16 -- play. Note they're global
17 vim.api.nvim_create_autocmd("LspAttach", { 17 vim.api.nvim_create_autocmd("LspAttach", {
18 once = true, 18 once = true,
19 group = "lsp_attach", 19 group = "lsp_attach",
20 callback = function() 20 callback = function(_)
21 vim.opt.number = true 21 vim.opt.number = true
22 vim.opt.updatetime = 250 22 vim.opt.updatetime = 250
23 end, 23 end,
24 }) 24 })
25 25
27 group = "lsp_attach", 27 group = "lsp_attach",
28 callback = function(args) 28 callback = function(args)
29 vim.api.nvim_create_autocmd("CursorHold", { 29 vim.api.nvim_create_autocmd("CursorHold", {
30 group = vim.api.nvim_create_augroup("lsp_buf_diags", { clear = true }), 30 group = vim.api.nvim_create_augroup("lsp_buf_diags", { clear = true }),
31 buffer = args.buf, 31 buffer = args.buf,
32 callback = vim.diagnostic.open_float, 32 callback = function(_) vim.diagnostic.open_float() end,
33 }) 33 })
34 end, 34 end,
35 }) 35 })

mercurial