LunarVim/lua/lv-neoformat/init.lua
2021-07-06 22:55:11 -04:00

16 lines
344 B
Lua

-- autoformat
if O.format_on_save then
require("lv-utils").define_augroups {
autoformat = {
{
"BufWritePre",
"*",
[[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]],
},
},
}
end
if not O.format_on_save then
vim.cmd ":autocmd! autoformat"
end