From 5ca4f0ef5b9ce30344ee11af8fa7d78ea98207c6 Mon Sep 17 00:00:00 2001 From: Simon Lasbrugnas Date: Fri, 23 Jan 2026 19:01:13 +0100 Subject: [PATCH] feat(conform): add terraform fmt --- lua/custom/plugins/conform.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/custom/plugins/conform.lua b/lua/custom/plugins/conform.lua index 7025d1a..52f7d90 100644 --- a/lua/custom/plugins/conform.lua +++ b/lua/custom/plugins/conform.lua @@ -13,6 +13,7 @@ return { css = { "prettier" }, xml = { "xmlformatter" }, svg = { "xmlformatter" }, + terraform = { "tfmt" }, javascript = { "biome", "prettier" }, javascriptreact = { "biome", "prettier" }, typescript = { "biome", "prettier" }, @@ -20,6 +21,14 @@ return { ["*"] = { "trim_whitespace" }, }, formatters = { + tfmt = { + condition = function() + return vim.bo.filetype == "terraform" + end, + command = "terraform", + args = { "fmt", "$FILENAME" }, + stdin = false, + }, biome = { condition = function() return vim.uv.fs_realpath("biome.json") ~= nil