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

19 lines
569 B
Lua

vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
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