From b5b58616cc29b5250ac481b894743c496e479332 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Fri, 17 Nov 2023 16:02:50 -0600 Subject: fix(nvim): fix bug in formatter --- nvim/.config/nvim/lua/plugins/conform.lua | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 92d896e..53f0c8b 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -2,10 +2,11 @@ local M = { "stevearc/conform.nvim", version = "*", - event = "BufReadPre", + cmd = { "ConformInfo" }, opts = { format_on_save = false, format_after_save = false, + log_level = vim.log.levels.DEBUG, formatters_by_ft = { lua = { "stylua" }, css = { "prettier" }, @@ -15,14 +16,17 @@ local M = { ["jinja.html"] = { "djlint" }, tex = { "latexindent" }, plaintex = { "latexindent" }, - markdown = { "prettier", "markdownlint", "cbfmt" }, + -- FIX: Move "injected" back to "*" if/when https://github.com/stevearc/conform.nvim/issues/200 is fixed. + markdown = { "prettier", "markdownlint", "injected" }, nginx = { "nginxbeautifier" }, python = { "black" }, + -- FIX: Remove if/when https://github.com/stevearc/conform.nvim/issues/127 gets fixed. + rust = { "rustfmt" }, sass = { "prettier" }, scss = { "prettier" }, sh = { "shfmt" }, PKGBUILD = { "shfmt" }, - ["*"] = { "injected" }, + -- ["*"] = { "injected" }, }, formatters = { latexindent = { @@ -34,17 +38,6 @@ local M = { prettier = { prepend_args = { "--prose-wrap", "always" }, }, - cbfmt = { - command = "cbfmt", - args = { - "--stdin-filepath", - "$FILENAME", - "--best-effort", - "--config", - ("%s/cbfmt/cbfmt.toml"):format(vim.env.XDG_CONFIG_HOME), - }, - stdin = true, - }, nginxbeautifier = { command = "nginxbeautifier", args = function(ctx) -- cgit v1.2.3-70-g09d2