BufWritePre enables format on save for lv-config.lua (#1111)

This commit is contained in:
rebuilt 2021-07-26 14:57:18 +02:00 committed by GitHub
parent 30c56e0b4a
commit 275c20a394
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,7 @@ local toggle_autoformat = function()
require("core.autocmds").define_augroups {
autoformat = {
{
"BufWritePost",
"BufWritePre",
"*",
":silent lua vim.lsp.buf.formatting_sync()",
},
@ -71,7 +71,7 @@ local toggle_autoformat = function()
end
if not lvim.format_on_save then
vim.cmd [[if exists('#autoformat#BufWritePost')
vim.cmd [[if exists('#autoformat#BufWritePre')
:autocmd! autoformat
endif]]
end