diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index c5b7efc..82c9b4a 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -11,11 +11,26 @@ return { javascriptreact = { "prettierd" }, json = { "prettierd" }, jsonc = { "prettierd" }, + toml = { "taplo" }, typescript = { "prettierd" }, typescriptreact = { "prettierd" }, }, format_on_save = { lsp_fallback = true, }, + formatters = { + taplo = { + args = function() + -- conform.nvim does not parse bash envvars, so we do it ourselves + local CONFIG_PATH = os.getenv("HOME") .. "/.config/taplo/taplo.toml" + return { + "format", + "--config", + CONFIG_PATH, + "-", + } + end, + }, + }, }, }