summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorJacek Kiedrowski <[email protected]>2021-07-05 23:26:25 +0100
committerGitHub <[email protected]>2021-07-05 23:26:25 +0100
commit5b497747448b3946675f7361c9667bb0dc1da11a (patch)
treef9f08a2729f7f3134675114ac97e128a8be08ee7 /init.lua
parent64e544b56114f7b93a56814067caa28c83cfaec4 (diff)
parenta469c710bfc01f291df68dba40464caaa2b496da (diff)
Merge branch 'ChristianChiarulli:master' into master
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 dd2bee0d..3eb76e76 100644
--- a/init.lua
+++ b/init.lua
@@ -12,3 +12,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