Skip to content

Instantly share code, notes, and snippets.

@Chouser
Created October 1, 2010 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chouser/606301 to your computer and use it in GitHub Desktop.
Save Chouser/606301 to your computer and use it in GitHub Desktop.
(set! *print-length* 103)
(set! *print-level* 15)
(use '[clojure.contrib.repl-utils :only [show add-break-thread!]])
(use '[clojure.pprint :only []])
(def *pprint*)
(defn my-repl []
(add-break-thread!)
(binding [*pprint* true]
(clojure.main/repl
:prompt #(printf
"\033[32m-----\033[m\n%s=> "
(ns-name *ns*))
:caught (fn [e]
(.print *err* "\033[31m")
(clojure.main/repl-caught e)
(.print *err* "\033[m"))
:print (fn [x]
(print "\033[34m")
(if *pprint*
(clojure.pprint/pprint x)
(prn x))
(print "\033[m")
(flush)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment