summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/cfg/neoformat
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-07 14:10:25 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-07 14:10:25 +0200
commit409dfed3237f9f0a6e96879078d1daf3d9c02e03 (patch)
treefd340e6803212b5ae401e2d6a1b524c412498663 /.config/nvim/lua/cfg/neoformat
parent4918f8747e2d3e4d3342bb1f5ee05db6198819d1 (diff)
Updated config again after Chris's updates
Diffstat (limited to '.config/nvim/lua/cfg/neoformat')
-rw-r--r--.config/nvim/lua/cfg/neoformat/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/nvim/lua/cfg/neoformat/init.lua b/.config/nvim/lua/cfg/neoformat/init.lua
new file mode 100644
index 0000000..eb9596e
--- /dev/null
+++ b/.config/nvim/lua/cfg/neoformat/init.lua
@@ -0,0 +1,12 @@
+-- autoformat
+if O.format_on_save then
+ require("cfg.utils").define_augroups {
+ autoformat = {
+ {
+ "BufWritePre",
+ "*",
+ [[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]],
+ },
+ },
+ }
+end