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
|
|
|
|
})
|
2023-09-22 17:24:40 +01:00
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
|
|
|
callback = function()
|
|
|
|
local ok, lint = pcall(require, "lint")
|
|
|
|
|
|
|
|
if not ok then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
lint.try_lint()
|
|
|
|
end
|
|
|
|
})
|