Tue 20 Jun 2017 — Tue 20 Mar 2018

Cider

Emacs mode for Clojure.

https://github.com/clojure-emacs/cider Cider Manual

Make a project with lein, then call cider-jack-in.

Cider talks to nREPL, which is part of Clojure. When you use cider-jack-in, it starts nREPL and injects the Cider middleware.

Useful Commands

TAB or M-tab
code completion (enable company-mode first)
M-x cider-repl-history
C-c C-m
Open a macro expansion buffer
C-c M-t v
trace function evaluation
M-x cider-classpath
see your dependencies
M-x cider-browse-ns
M-x cider-browse-spec
browse the Clojure specs registry

Features

There is cider-stacktrace-mode with various extra navigation commands.

There are lots of ways to run tests.

There is a debugger, and it is good.

cider-enlighten-mode lets you see locals in real-time

ClojureScript

Cider can work with ClojureScript and Figwheel.

You need:

  • piggieback
  • figwheel-sidecar

Then you need to do some Emacs config:

(setq cider-cljs-lein-repl
      "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))")