nrepl-pprint-middleware is an nREPL middleware that uses clojure.pprint to pretty-print all REPL results. This improves readability for large and deeply-nested collections.
You may find nrepl-pprint-middleware useful if your nREPL tooling
doesn’t pretty-print. I use it with monroe, for example. You may also
find it useful if you start an nREPL in production and connect to it
with lein repl :connect ...
.
Add to your ~/.lein/profiles.clj
:
{:user {:dependencies [[name.atw/nrepl-pprint-middleware version-goes-here]]
:repl-options {:nrepl-middleware [nrepl-pprint-middleware.pprint/wrap-pprint]}}}
If you start an nREPL in your deployed application, you can also add nrepl-pprint-middleware to your production nREPL. Add it to your Leiningen dependencies:
[name.atw/nrepl-pprint-middleware version-goes-here]
Then somewhere in your application, start an nREPL with nrepl-pprint-middleware:
(ns ...
(:require [nrepl.server :as nrepl]
nrepl-pprint-middleware.pprint))
(defonce nrepl-server
(nrepl/start-server
:bind ... :port ...
:handler (nrepl/default-handler nrepl-pprint-middleware.pprint/wrap-pprint)))