From a247d69c82109230656c6eb10a7824794ee5e911 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Wed, 7 Jul 2021 19:27:27 -0400 Subject: refactoring whichkey --- lua/lv-neoformat/init.lua | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'lua/lv-neoformat') diff --git a/lua/lv-neoformat/init.lua b/lua/lv-neoformat/init.lua index ea3ff43c..4dbaad23 100644 --- a/lua/lv-neoformat/init.lua +++ b/lua/lv-neoformat/init.lua @@ -1,18 +1,23 @@ -- 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]], - }, - }, - }) + require("lv-utils").define_augroups { + autoformat = { + { + "BufWritePre", + "*", + [[try | undojoin | Neoformat | catch /^Vim\%((\a\+)\)\=:E790/ | finally | silent Neoformat | endtry]], + }, + }, + } end +vim.g.neoformat_run_all_formatters = 0 + +vim.g.neoformat_enabled_python = { "autopep8", "yapf", "docformatter" } +vim.g.neoformat_enabled_javascript = { "prettier" } + if not O.format_on_save then - vim.cmd([[if exists('#autoformat#BufWritePre') + vim.cmd [[if exists('#autoformat#BufWritePre') :autocmd! autoformat - endif]]) + endif]] end -- cgit v1.2.3