-
-
Notifications
You must be signed in to change notification settings - Fork 110
Quick start: Clojure
Clojure is a robust, practical, and fast programming language with a set of useful features that together form a simple, coherent, and powerful tool.
Conjure has deep support for Clojure either in the original JVM setting or JavaScript via ClojureScript. We’re focusing on regular JVM Clojure here, see other guides for specifics on ClojureScript since it has it’s own nuances.
-
Install the latest Neovim.
-
Install the Conjure plugin.
-
Install the Clojure CLI tools (my preference) or Leiningen.
-
Get a project set up with the CLI tools or Leingingen.
You can skip this section by installing vim-jack-in and executing the appropriate command such as :Clj
or :Lein
. It’ll start an nREPL server with all of the appropriate middleware inside your Neovim instance, you can then connect to it as described in the final section.
Configure your deps.edn
like so to acquire the appropriate dependencies.
{:deps
{org.clojure/clojure {:mvn/version "1.10.1"}
nrepl/nrepl {:mvn/version "0.7.0"}
cider/cider-nrepl {:mvn/version "0.25.2"}}}
Now start your nREPL server with the added CIDER middleware.
clj -m nrepl.cmdline \
--middleware "[cider.nrepl/cider-middleware]" \
--interactive
Alternatively, you can start the same thing without creating a deps.edn
file with this.
clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.2"}}}' \
-m nrepl.cmdline \
--middleware '["cider.nrepl/cider-middleware"]' \
--interactive
Now open any .clj
or .cljc
file and start evaluating! It will automatically connect to the correct host and port as you open a file providing the .nrepl-port
was created when you started your REPL (this should be the case). If not, you can either create that file yourself or use :ConjureConnect [port]
to get started.
If you’re unsure how to evaluate things with Conjure, please refer to :help conjure
, :help conjure-client-clojure-nrepl
and :ConjureSchool
(an interactive tutorial).