Closed maikol-solis closed 2 weeks ago
You are right, I am actually using evil-indent
all the time except in lsp managed buffers where this is handled by the lsp entirely, so I haven't noticed yet.
Lets see how the other package performs.
Hmm this doesn't look like a drop in replacement different layers have different formatting functions in place so we cannot use the global config instead we have to configure this in more detail for our own, not to interfere with the existing infrastructure.
I may have a look into this when I find the time if nobody else wants to tackle this in the meantime.
I have had a look into apheleia unfortunately this is only a controller for formatters it does not provide concrete formatter implementations except some sample ones for php, js and go.
While such a system is nice I would not focus on modernizing it as all newer modes move to LSP servers anyway which handle the formatting on a much more efficient manner outside of emacs. Legacy modes can work with srefactor as long as they are maintained.
One of the big exceptions there is elisp, here however I have not seen a suitable formatter for this yet. For now I have added an additional binding for SPC m = =
which will format the buffer using core functions which use evil-indent internally. This gives reasonable results.
Now all elisp buffers are formatted on save by default just like in go. This should also make reviewing code change easier.
If you have found a suitable external formatter for elisp feel free to open a PR or feature ticket for it, until we have one we are using the internal one.
Hi!
apheleia (https://github.com/radian-software/apheleia) provides a better and stable way to format buffers. I have issues with srefactor because it doesn't format correctly my init.el.
For example, something like
is formatted like
Best.