mirror of
https://github.com/youwen5/neovim-flake.git
synced 2024-11-25 03:03:49 -08:00
55 lines
1,003 B
Nix
55 lines
1,003 B
Nix
# Code formatters
|
|
{ pkgs, ... }:
|
|
{
|
|
extraPackages = with pkgs; [
|
|
# TS/JS, Markdown, TOML, JSON, etc
|
|
nodePackages.prettier
|
|
|
|
# Rust
|
|
rustfmt
|
|
|
|
# Nix
|
|
nixfmt-rfc-style
|
|
|
|
# Python
|
|
black
|
|
|
|
# Lua
|
|
stylua
|
|
|
|
# Haskell
|
|
haskellPackages.fourmolu
|
|
|
|
taplo
|
|
|
|
# Misc
|
|
# codespell
|
|
];
|
|
|
|
plugins.conform-nvim = {
|
|
enable = true;
|
|
settings = {
|
|
format_on_save = {
|
|
timeoutMs = 500;
|
|
lspFallback = true;
|
|
};
|
|
formatters_by_ft = {
|
|
lua = [ "stylua" ];
|
|
python = [ "black" ];
|
|
nix = [ "nixfmt" ];
|
|
svelte = [ "prettier" ];
|
|
rust = [ "rustfmt" ];
|
|
haskell = [ "fourmolu" ];
|
|
toml = [ "taplo" ];
|
|
json = [ "prettier" ];
|
|
markdown = [ "prettier" ];
|
|
yaml = [ "prettier" ];
|
|
html = [ "prettier" ];
|
|
javascript = [ "prettier" ];
|
|
typescript = [ "prettier" ];
|
|
# "*" = ["codespell"];
|
|
"_" = [ "trim_whitespace" ];
|
|
};
|
|
};
|
|
};
|
|
}
|