From 91c08532a1dabb43ab4c7ed259d478a0f7d2175d Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 2 Sep 2024 18:25:15 -0700 Subject: [PATCH] formatters: add for common languages --- config/plugins/formatters.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/config/plugins/formatters.nix b/config/plugins/formatters.nix index 2100848..2ea6c7e 100644 --- a/config/plugins/formatters.nix +++ b/config/plugins/formatters.nix @@ -1,14 +1,14 @@ # Code formatters {pkgs, ...}: { extraPackages = with pkgs; [ - # TS/JS + # TS/JS, Markdown, TOML, JSON, etc nodePackages.prettier # Rust rustfmt # Nix - alejandra + nixfmt-rfc-style # Python black @@ -20,7 +20,7 @@ haskellPackages.fourmolu # Misc - codespell + # codespell ]; plugins.conform-nvim = { @@ -33,11 +33,18 @@ formatters_by_ft = { lua = ["stylua"]; python = ["black"]; - nix = ["alejandra"]; + nix = ["nixfmt"]; svelte = ["prettier"]; rust = ["rustfmt"]; haskell = ["fourmolu"]; - "*" = ["codespell"]; + toml = ["prettier"]; + json = ["prettier"]; + markdown = ["prettier"]; + yaml = ["prettier"]; + html = ["prettier"]; + javascript = ["prettier"]; + typescript = ["prettier"]; + # "*" = ["codespell"]; "_" = ["trim_whitespace"]; }; };