cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Option to leave manual alignment unchanged

Open imrekoszo opened this issue 5 months ago • 0 comments

Sometimes I like to organize data in a tabular-ish format, for example vectors that represent tables, case, cond, are forms etc.

[1   2   3
 10  20  30
 100 200 300]

(case x
  1   :one
  10  :ten
  100 :hundred)

{:foo  1
 :quux 2
 
 :other/bar    55
 :other/longer 66}

Cursive currently formats this to:

[1 2 3
 10 20 30
 100 200 300]

(case x
  1 :one
  10 :ten
  100 :hundred)

;; if map value alignment is on
{:foo          1
 :quux         2

 :other/bar    55
 :other/longer 66}

;; if it's off
{:foo 1
 :quux 2

 :other/bar 55
 :other/longer 66}

It would be nice to be able to tell Cursive to preserve these manual alignments.

Related issues/outside references:

  • #2176
  • #1571
  • #1403
  • #949
  • #938
  • #888
  • in general I like where https://github.com/oakmac/standard-clojure-style-js?tab=readme-ov-file#formatting-rules is going
    • it is based on https://tonsky.me/blog/clojurefmt/ and https://github.com/clj-commons/formatter/issues/9 among others

imrekoszo avatar Aug 30 '24 12:08 imrekoszo