feat: add toml formatting

This commit is contained in:
Devin Haska 2024-06-17 21:21:13 -07:00
parent e5f0d9bc25
commit 36de7c527d
No known key found for this signature in database

View file

@ -11,11 +11,26 @@ return {
javascriptreact = { "prettierd" }, javascriptreact = { "prettierd" },
json = { "prettierd" }, json = { "prettierd" },
jsonc = { "prettierd" }, jsonc = { "prettierd" },
toml = { "taplo" },
typescript = { "prettierd" }, typescript = { "prettierd" },
typescriptreact = { "prettierd" }, typescriptreact = { "prettierd" },
}, },
format_on_save = { format_on_save = {
lsp_fallback = true, 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,
},
},
}, },
} }