nvim.nix/config/plugins/lsp/conform.nix

27 lines
520 B
Nix
Raw Normal View History

2024-08-08 09:58:48 +08:00
{pkgs, ...}: {
2024-08-08 09:50:00 +08:00
plugins.conform-nvim = {
enable = true;
# Run the formatter on file save.
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
# Receive notificaton when a formatter errors.
notifyOnError = true;
# Map of filetype to formatters.
formattersByFt = {
c = ["clang-format"];
nix = ["alejandra"];
2024-08-14 20:20:10 +08:00
haskell = ["stylish-haskell"];
2024-08-08 09:50:00 +08:00
};
};
2024-08-08 09:58:48 +08:00
2024-08-08 09:50:00 +08:00
# Install our formatters.
extraPackages = with pkgs; [
alejandra
2024-08-14 20:20:10 +08:00
stylish-haskell
2024-08-08 09:50:00 +08:00
];
}