nvimdotfiles/lua/myworkflow/autocommands.lua

22 lines
536 B
Lua
Raw Normal View History

local group = vim.api.nvim_create_augroup("autoformat", {})
vim.api.nvim_create_autocmd('BufWritePre', {
group = group,
callback = function()
vim.lsp.buf.format { async = false }
end
})
local gotests = require("myworkflow.go-tests")
local atgroup = vim.api.nvim_create_augroup("autotest", {})
vim.api.nvim_create_autocmd('BufWritePost',
{
group = atgroup,
pattern = { "*.go" },
callback = function()
gotests.goRunTests()
gotests.goSetMarks()
end
}
)