formatters: add for common languages

This commit is contained in:
Youwen Wu 2024-09-02 18:25:15 -07:00
parent 1b5e491ac9
commit 91c08532a1
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -1,14 +1,14 @@
# Code formatters # Code formatters
{pkgs, ...}: { {pkgs, ...}: {
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# TS/JS # TS/JS, Markdown, TOML, JSON, etc
nodePackages.prettier nodePackages.prettier
# Rust # Rust
rustfmt rustfmt
# Nix # Nix
alejandra nixfmt-rfc-style
# Python # Python
black black
@ -20,7 +20,7 @@
haskellPackages.fourmolu haskellPackages.fourmolu
# Misc # Misc
codespell # codespell
]; ];
plugins.conform-nvim = { plugins.conform-nvim = {
@ -33,11 +33,18 @@
formatters_by_ft = { formatters_by_ft = {
lua = ["stylua"]; lua = ["stylua"];
python = ["black"]; python = ["black"];
nix = ["alejandra"]; nix = ["nixfmt"];
svelte = ["prettier"]; svelte = ["prettier"];
rust = ["rustfmt"]; rust = ["rustfmt"];
haskell = ["fourmolu"]; haskell = ["fourmolu"];
"*" = ["codespell"]; toml = ["prettier"];
json = ["prettier"];
markdown = ["prettier"];
yaml = ["prettier"];
html = ["prettier"];
javascript = ["prettier"];
typescript = ["prettier"];
# "*" = ["codespell"];
"_" = ["trim_whitespace"]; "_" = ["trim_whitespace"];
}; };
}; };