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

20 lines
569 B
Lua
Raw Normal View History

2023-11-08 15:33:21 +01:00
vim.o.updatetime = 250
2024-07-25 20:09:29 +02:00
2023-11-08 15:33:21 +01:00
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
2024-07-25 20:09:29 +02:00
local nvim_lsp_omit_dir = os.getenv("NVIM_LSP_OMIT_DIR")
if not nvim_lsp_omit_dir then
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
})
end