How may I customize indentation?

Hi,

Awesome plugin. One thing I would like to be able to customize is the indentation. Here is an example of my goal:

Default indentation in La Clojure, note the second argument to '/' is one char left of the first argument:


(defn average [& numbers]
  (/ (apply + numbers)
    (count numbers)))


Here is the Emacs-ish indentation that I want to use, note the 2nd argument to '/' is aligned with the first:


(defn average [& numbers]
  (/ (apply + numbers)
      (count numbers)))


Is there a setting for this?

If not, is there a place in the code that I should look?

If there is any interest, should I add this as a setting?

2 comments

Even though the post is quire old, I'll still answer it. Mb someone can benefit from my answer.

org.jetbrains.plugins.clojure.formatter

ClojureIndentOptionsProvider. There are two hard-coded variables:

    indentOptions.INDENT_SIZE = 2;
    indentOptions.TAB_SIZE = 2;

It's probably what you are looking for.

0

Actually question was about alignment.
To make to formatting blocks aligned you need to put the same Alignment object to few formatting blocks. Also you need to return right alignment in method getChildAttributes of formatting block.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.