radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
517 stars 73 forks source link

No auto-formatting with `nix-ts-mode' #298

Open ZharMeny opened 2 months ago

ZharMeny commented 2 months ago

With apheleia-global-mode enabled, nixfmt isn't run automatically on save when using nix-ts-mode instead of nix-mode, as nix-ts-mode doesn't derive from nix-mode and is not in the default apheleia-mode-alist.

peterhoeg commented 2 weeks ago

Until the mentioned PR is merged and if you someone is using doom emacs, the following can be used as a workaround:

    (set-formatter! 'nixpkgs-fmt '("nixpkgs-fmt") :modes '(nix-mode nix-ts-mode))

If you're not using doom, you can of course just manipulate apheleia-formatters directly.