Skip to content

Instantly share code, notes, and snippets.

@thickey
Last active March 9, 2023 17:47
Show Gist options
  • Save thickey/9d30650e51dda5a0f61250291d7a39d4 to your computer and use it in GitHub Desktop.
Save thickey/9d30650e51dda5a0f61250291d7a39d4 to your computer and use it in GitHub Desktop.
Cider jack-in with tools.deps

Instructions

Note: you must have Cider version 0.18.*

For pure tools.deps (non-lein)

In deps.edn

{:paths ["src" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.9.0"}}
 :aliases
 {:cider-clj {:extra-deps {org.clojure/clojure {:mvn/version "1.9.0"}
                           cider/cider-nrepl {:mvn/version "0.18.0"}}
              :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}

In Emacs:

(setq cider-clojure-cli-global-options "-R:cider-clj")

Now cider-jack-in will launch nrepl and connect.


For a leiningen project

(defproject day-of-datomic "0.1.0-SNAPSHOT"
  :plugins [[lein-tools-deps "0.4.1"]]
  :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
  :lein-tools-deps/config {:config-files [:install :user :project]})

Note: now you remove the :dependencies key, as they are all in your deps.edn file



Follow the above snippets for this simple stuff.

If you want to launch nrepl server yourself, you can do this but I wanted less steps.

There is also an inf-clojure package which understands tools.deps if you want something closer to inferior-lisp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment