Sunday, February 3, 2013

Use lein 2 with swank clojure

If you are Clojure dev and not really ready to make the jump to nrepl but got to use lein 2.0, here is what you can do to save yourself some trouble. Lein 2 supports user profiles and you can add following to ~/.lein/profiles.clj:

{:user {:plugins [[lein-swank "1.4.5"]
                  [lein-pprint "1.1.1"]]}}

You can take out pprint but it is nice to have if you want to pretty print some data from your repl. 

Then you can cd to the directory where you have project.clj and simply run:
  • lein swank
  • slime-connect (from within emacs)
Now, enjoy all the goodies of lein 2 and stay with your good old friend slime.