summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrebuilt <[email protected]>2021-07-26 14:57:18 +0200
committerGitHub <[email protected]>2021-07-26 17:27:18 +0430
commit275c20a394ef9c239d08a03258849255ed496c0f (patch)
tree6256f00a7c5a63ec7859e8bcc0b31315674fce7f
parent30c56e0b4a6a8f9b661a8e4fdeede2d47e82ca38 (diff)
BufWritePre enables format on save for lv-config.lua (#1111)
-rw-r--r--lua/lv-utils/init.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lua/lv-utils/init.lua b/lua/lv-utils/init.lua
index 29d05fe2..f76d0de2 100644
--- a/lua/lv-utils/init.lua
+++ b/lua/lv-utils/init.lua
@@ -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