From d56380590975f4738029777fc0fa45cd59fb306a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 23:23:02 +0200 Subject: [PATCH] chore(neovim): update formatter configurations --- modules/home-manager/cli/neovim/default.nix | 2 +- .../cli/neovim/files/plugins/conform.lua | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 9d928b1..aa5bb6e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -71,7 +71,7 @@ in yaml-language-server # Formatters - nixfmt-rfc-style + alejandra shfmt yamlfmt ]; diff --git a/modules/home-manager/cli/neovim/files/plugins/conform.lua b/modules/home-manager/cli/neovim/files/plugins/conform.lua index 5e3c884..1a45416 100644 --- a/modules/home-manager/cli/neovim/files/plugins/conform.lua +++ b/modules/home-manager/cli/neovim/files/plugins/conform.lua @@ -4,10 +4,20 @@ require("conform").setup({ timeout_ms = 500, lsp_format = "never", }, + formatters = { + terraform = { + inherit = false, + command = "tofu", + args = { "fmt", "-" }, + stdin = true, + }, + }, formatters_by_ft = { - yaml = {"yamlfmt"}, - sh = { "shfmt" }, go = { "gofmt" }, + nix = { "alejandra" }, + sh = { "shfmt" }, + terraform = { "terraform" }, + yaml = {"yamlfmt"}, ["_"] = { "trim_whitespace" }, } })