I've started letting LSP do the formatting control in my practicalli/spacemacs.d configuration, rather than Cider. This seems to work quite well, although it seems to be missing automatic vertical alignment of pairs, as in let statements, loop or for arguments or in hash-maps. I've also added updates from the spacemacs.tempate after pulling the latest commits to Spacemacs itself. https://github.com/practicalli/spacemacs.d
Nice! Yes, there is a issue for that on cljfmt :) c/c @lee
Yeah, I’m trying to get some input on what folks would want for vertical alignment formatting from cljfmt. My thinking is something you’d have a preference for (on or off) but something you want to sometimes enable/disable for a specific forms, probably through some inline directive.
Yeah, it's a good question
maybe some way to specify the forms you want vertical align would work for everyone?
with a :all
option flag as well?
There’s a https://docs.cider.mx/cider/indent_spec.html which, for some reason, has not been widely adopted. Maybe we could add an inline {:style/vertical-align (true|false)}
. Which would override some project default which would override a default of false
.
Thanks for the reminder, I will go and add some examples and my shopping list of features 🙂
Here’s the https://github.com/weavejester/cljfmt/issues/36 if you have anything to add!
@lee I've added some initial thoughts and examples of what I currently do. I'll add more if I think of anything. Happy to do some beta testing if needed. Thank you.
Cool, thanks so much @jr0cket!
You're doing the lords work @jr0cket 🙂
Possibly, but the work for which lord I cannot be certain of though 🙂 I certainly appreciate @lee spending time on this issue and @ericdallo for all the help with making lsp work for me (and a great many others)
Thanks John, I started work on cljfmt vertical alignment in Feb of 2019, and then figured I should fix a bug in rewrite-cljs to aid the fix, then… well… rewrite-cljc then rewrite-clj v1 and finally… maybe I’ll actually get back to what sparked my meandering journey: the cljfmt vertical alignment feature!
I’ll certainly take you up on your offer of testing when the time comes!