-
-
Save dln/407622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is ~/.clojure/repl-init.clj | |
; | |
; I start a clojure repl something like: | |
; | |
; rlwrap --remember --complete-filenames \ | |
; --history-filename ~/.clojure/history \ | |
; --break-chars "\"\\'(){}[],^%$#@;:|" \ | |
; java -server -cp 'src/:lib/*' clojure.main \ | |
; -i ~/.clojure/repl-init.clj | |
(use 'clojure.contrib.repl-utils) | |
(use '[clojure.contrib.pprint :only []]) | |
(add-break-thread!) | |
(defn my-repl [] | |
(clojure.main/repl | |
:prompt #(printf | |
"\033[1;38;5;51m%s \033[1;38;5;45m>>>\033[0m " | |
(ns-name *ns*)) | |
:print (try | |
(fn [x] | |
(print "\033[38;5;77m") | |
((resolve 'clojure.contrib.pprint/pprint) x) | |
(print "\033[m\n") | |
(flush)) | |
(catch Exception e | |
(prn e))) | |
:caught (fn [x] | |
(print "\033[38;5;220m") | |
(prn x) | |
(print "\033[m\n") | |
(flush)))) | |
(set! *print-length* 103) | |
(set! *print-level* 15) | |
(my-repl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment