clojure-quick-repls

https://github.com/symfrog/clojure-quick-repls.git

git clone 'git://github.com/symfrog/clojure-quick-repls.git'
27

clojure-quick-repls

Emacs functions for quickly creating Clojure and ClojureScript repls for a project.

Once the repls are created the usual CIDER commands can be used in either a clj/cljs buffer and the forms will be routed automatically via the correct connection.

So no need to manually switch connections!

Installation

The recommended way to install is via MELPA using package.el.

You can install clojure-quick-repls using the following command:

M-x package-install [RET] clojure-quick-repls [RET]

or if you'd rather keep it in your dotfiles:

(unless (package-installed-p 'clojure-quick-repls)
  (package-refresh-contents))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents

Make sure you have piggieback as a dependency in project.clj.

Also requires CIDER. The latest CIDER snapshot should be used since clojure-quick-repls maintains compatibility with the latest CIDER snapshot as closely as possible.

Usage

Open any Clojure file in the project that you wish to have Clojure/ClojureScript repls for, then

M-x clojure-quick-repls-connect

Do not attempt to execute clojure-quick-repls-connect twice, if you need to restart run cider-quit and then clojure-quick-repls-connect.

You can now connect the browser and execute any cider command in either a clj/cljs buffer and the forms will be routed to the correct connection.

cider-switch-to-relevant-repl-buffer (C-c C-z)

If you would like to be able to switch to the relevant repl buffer based on if you are currently in a clj or cljs buffer then you need to set the custom variable cider-switch-to-repl-command to clojure-quick-repls-switch-to-relevant-repl

You can set a custom variable using:

M-x customize

After setting the custom variable you should have an form under custom-set-variables that looks like:

    '(cider-switch-to-repl-command (quote clojure-quick-repls-switch-to-relevant-repl))

so a custom-set-variables form with only this variable set would look like:

    (custom-set-variables
    ;; custom-set-variables was added by Custom.
    ;; If you edit it by hand, you could mess it up, so be careful.
    ;; Your init file should contain only one such instance.
    ;; If there is more than one, they won't work right.
    '(cider-switch-to-repl-command (quote clojure-quick-repls-switch-to-relevant-repl)))

License

Distributed under the GNU General Public License, version 3