mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
BufWritePre enables format on save for lv-config.lua (#1111)
This commit is contained in:
parent
30c56e0b4a
commit
275c20a394
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue