formateo automatico para go

This commit is contained in:
serxoz 2024-03-04 16:28:56 +01:00
parent 5afee66cfe
commit f036fe3648

View File

@ -1,2 +1,16 @@
require("serxoz") require("serxoz")
require('serxoz.packer') require('serxoz.packer')
-- autoformat
vim.api.nvim_create_augroup("AutoFormat", {})
vim.api.nvim_create_autocmd(
"BufWritePost",
{
pattern = "*.go",
group = "AutoFormat",
callback = function()
vim.cmd("silent !go fmt %")
vim.cmd("edit")
end,
}
)