Hooks can change how the server evals code, prints results, and reports errors. Each hook function is given the default function and returns a new one:
:eval-hook: Givenclojure.core/eval, return a function ofform.:print-hook: Given nREPL's print function, return a function ofvalue writer options.:caught-hook: Givenclojure.main/repl-caught, return a function ofthrowable.
Pretty print all results:
;; .cljconf/org.clojure/clojure-cli.repl.edn
{:print-hook dev.hooks/pprint-values}(ns dev.hooks
(:require [clojure.pprint :as pprint]))
(defn pprint-values [_default-print]
(fn [value writer _options]
(pprint/pprint value writer)))