From 226b432bed179b12cffd4daf4bea26b98c9f54fe Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Tue, 27 May 2025 11:54:48 -0700 Subject: [PATCH] feat: add toml formatting --- lua/plugins/formatting.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, + }, + }, }, }