clojureclojurescriptcider

Custom indentation in Clojurescript and Cider for 3rd party macro


I use the async macro in Clojurescript

(:require
 [cljs.test :refer-macros [async deftest is testing run-tests]]

and Cider wants to indent it like this

(async done
       (go

The Cider manual only talks about custom indentation for 1st party macros

https://cider.readthedocs.io/en/latest/indent_spec/ https://cider.readthedocs.io/en/latest/configuration/indentation/

How do I tell Ciderto use {:style/indent 1} for a 3rd party macro in Clojurescript?


Solution

  • This can be configured in clojure-mode (a dependency of CIDER), documentation is here.

    For example, (put-clojure-indent 'async 1).