nvim.d/nvim/lua/autocommands.lua

19 lines
381 B
Lua
Raw Normal View History

2023-05-17 22:37:30 +01:00
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = '*.go',
callback = function()
vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
end
})
vim.api.nvim_create_autocmd('BufWritePost', {
callback = function()
local ok, lint = pcall(require, "lint")
if not ok then
return
end
lint.try_lint()
end
})