dot/.config/nvim/lua/config/autocmds.lua
2024-07-25 20:09:29 +02:00

15 lines
455 B
Lua

vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
callback = function(args)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = args.buf,
callback = function()
vim.lsp.buf.format { async = false, id = args.data.client_id }
end,
})
end
})