summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorRafael <[email protected]>2021-07-05 20:01:19 +0000
committerGitHub <[email protected]>2021-07-05 16:01:19 -0400
commit71c5cb4f0be89d3a175e99b0c2ebc5e55178e8a9 (patch)
tree941ed16b7e2f84ec45ce9b2c4a3d6d638cf584a7 /init.lua
parent9d399314d4ef9b05df738dda016ea52ec2e85823 (diff)
(feat) use neoformat as the defalt format option (#715)
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 8e44e868..2b5a9515 100644
--- a/init.lua
+++ b/init.lua
@@ -11,3 +11,16 @@ require "lsp"
if O.lang.emmet.active then
require "lsp.emmet-ls"
end
+
+-- 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