2023-10-27 21:56:48 +00:00
|
|
|
local group = vim.api.nvim_create_augroup("autoformat", {})
|
2023-10-19 07:42:48 +00:00
|
|
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
2023-10-27 21:56:48 +00:00
|
|
|
group = group,
|
2023-10-19 07:42:48 +00:00
|
|
|
callback = function()
|
|
|
|
vim.lsp.buf.format { async = false }
|
|
|
|
end
|
|
|
|
})
|
2023-10-27 21:56:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
)
|