-
Notifications
You must be signed in to change notification settings - Fork 0
Running figwheel with Emacs Inferior Clojure Interaction Mode
Assuming you already have clojure-mode
, run M-x package-list-packages
and install inf-clojure
.
Edit your .emacs
or init.el
and add a function like the following:
(defun figwheel-repl ()
(interactive)
(run-clojure "lein figwheel"))
(add-hook 'clojure-mode-hook #'inf-clojure-minor-mode)
Restart Emacs!
Open your ClojureScript file and run M-x figwheel-repl
. You'll get a new buffer with the REPL. Switch back to your file.
-
C-c C-l
will load the file. -
C-c Meta-n
will switch your namespace. - If you place your cursor at the end of a s-expression,
C-x C-e
will evaluate that expression. -
C-c C-v
will show the docs.C-c C-s
will show the source.C-c <return>
will macroexpand.
Refer to inf-clojure for more documentation.
You are done!
These instructions are for advanced users and can stand to be clarified a bit. Please don't attempt this unless you have a bunch of experience with the stack.
If you are using the JAR in your current directory:
Create a script/repl.clj
with the following contents:
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
note: leiningen profile merging won't occur with start-figwheel!
Edit your .emacs
or init.el
and add a function like the following if you are using the JAR in your current directory:
(defun figwheel-repl ()
(interactive)
(run-clojure "lein trampoline run -m clojure.main script/repl.clj"))
Open your ClojureScript file and run M-x figwheel-repl
. You'll get a new buffer with the REPL. Switch back to your file and run M-x inf-clojure-minor-mode
. C-c C-l
will load the file. C-c Meta-n
will switch your namespace. If you place your cursor at the end of a s-expression, C-x C-e
will evaluate that expression. C-c C-v
will show the docs. C-c C-s
will show the source. C-c <return>
will macroexpand. Refer to inf-clojure for more documentation.