cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Support formatting like `cljfmt`'s new alignment features

Open nhooey opened this issue 1 month ago • 1 comments

It would be great if Cursive could use cljfmt somehow, or support the new features:

{:align-forms?                    true
 :align-form-columns?             true
 :align-map-columns?              true}

The weavejester/cljfmt Clojure formatter has been updated in the last few weeks to support those new indentation features:

It aligns all function parameter S-expressions on the same level, when they're on separate lines, which makes it much easier to see the control flow.

I currently solve this problem with the File Watchers plugin and set per-project File Watchers for each of the Clojure file types, but keep the Cursive indentation as the first pass. But I have to save the file to format like cljfmt instead of Cursive's default.

nhooey avatar Oct 30 '25 22:10 nhooey

Yes, I have a project planned for the short term to add a new cljfmt compatible formatter to Cursive. I can't use cljfmt directly because of how the IntelliJ formatter works, but I think I should be able to mimic it and also read the config from the cljfmt config so it should all just work transparently. Cursive does already support aligning map entry values and also let-binding forms, but it's harder to customise than what cljfmt supports now.

cmf avatar Nov 06 '25 06:11 cmf