Closed nyawox closed 6 months ago
I think just (set-formatter! 'alejandra '("alejandra" "--quiet") :modes '(nix-mode))
is sufficient (and it works for me). And if I read the previous code right it will also work on pre-apheleia
Doom, but someone should probably test that.
set-formatter!
replaces any existing entries from apheleia-mode-alist
and apheleia-formatters
(and that's all it does). So the after!
half of the above looks like it's overwriting the apheleia-formatters
entry it just added with set-formatter!
.
And it looks like the only problem is that the old code accepted either a string or a list for the command to run, while apheleia
needs a list.
I don't use doom emacs anymore except for magit, but I believe this can be closed now since #413 got merged
After doom migrating from
format-all
toapheleia
(set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode))
Does not work and gives error saying formatter must be a shell command or a lisp function See hereI got this snippet from random config on GitHub working, but I didn't know if it was good enough to make a PR.
Some people can be using older version and
nix-doom-emacs
pins doom to older version, so I think it would be preferable to still leave document for older versions.