summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/cfg/neoformat
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-08 15:28:34 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-07-08 15:28:34 +0200
commit56e16603121f94b6ea4b7125c596a09540569841 (patch)
tree252afa6c8680f58095771f437f6ad516fda4fe13 /.config/nvim/lua/cfg/neoformat
parent235a49fe4ab108abbecf43066a7a37133bb49bc9 (diff)
Latest updates from LunarVim, new handrolled colorscheme
Diffstat (limited to '.config/nvim/lua/cfg/neoformat')
-rw-r--r--.config/nvim/lua/cfg/neoformat/init.lua29
1 files changed, 20 insertions, 9 deletions
diff --git a/.config/nvim/lua/cfg/neoformat/init.lua b/.config/nvim/lua/cfg/neoformat/init.lua
index eb9596e..9a5ac76 100644
--- a/.config/nvim/lua/cfg/neoformat/init.lua
+++ b/.config/nvim/lua/cfg/neoformat/init.lua
@@ -1,12 +1,23 @@
-- 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]],
- },
- },
- }
+ require("cfg.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 = { "flake8", "black", "docformatter" }
+vim.g.neoformat_enabled_javascript = { "prettier" }
+
+if not O.format_on_save then
+ vim.cmd([[if exists('#autoformat#BufWritePre')
+ :autocmd! autoformat
+ endif]])
end