Skip to content

Using the Figwheel REPL with Vim

Laurent Senta edited this page Nov 26, 2016 · 5 revisions

Requirements

Setup

As of v0.5.8, after following the setup guide you should have something like:

{
  :source-paths ["src/clj" "src/cljc"]

  :profiles
  {:dev
   {:dependencies [[figwheel-sidecar "0.5.8"]
                   [com.cemerick/piggieback "0.2.1"]]
    :source-paths ["src/cljs"]
    :plugins      [[lein-figwheel "0.5.8"]]}
    ...
  }
  :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
  ...
}

Start figwheel

lein repl
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)

Note you should have only one nREPL process starting, fireplace will connect there and create a cljs session.

Open the figwheel instance in your browser (usually localhost:3449).

Start vim

It should auto-connect using the .nrepl-port file.

You can check the connection by eval'ing (cpp) a clojure file, if it takes less than a second (no repl starting cost) you're good.

Use :Connect to connect to the repl by hand.

Piggieback on Clojurescript

Run the following command to connect Fireplace to the Figwheel REPL (instead of the default Rhino repl):

:Piggieback (figwheel-sidecar.repl-api/repl-env)