summaryrefslogtreecommitdiff
path: root/lua/lv-neoformat/init.lua
blob: a1540370aea6e4804207e6e98159c67734bffff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- 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

if not O.format_on_save then
  vim.cmd ":autocmd! autoformat"
end