I have a plugin that autosaves the file. This plugin has hooks like .hook_before_saving etc. Here is an example:
local autosave = require("autosave")
autosave.hook_before_saving = function ()
if <condition> then
vim.g.auto_save_abort = true -- Save will be aborted
end
end
I would like to use different formaters like prettier for javascript or cargo fmt for rust every time the file is autosaved.
Is it possible?