Created
May 20, 2010 12:51
-
-
Save Chouser/407528 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 -Xbootclasspath/a:clojure.jar \ | |
; -cp clojure.jar:clojure clojure.main \ | |
; -i ~/.clojure/repl-init.clj -e "(my-repl)" | |
(set! *print-length* 103) | |
(set! *print-level* 15) | |
(use 'clojure.contrib.repl-utils) | |
(use '[clojure.contrib.pprint :only []]) | |
(add-break-thread!) | |
(defn my-repl [] | |
(clojure.main/repl | |
:prompt #(printf | |
"\033[32m-----\033[m\n%s=> " | |
(ns-name *ns*)) | |
:print (try | |
(fn [x] | |
(print "\033[34m") | |
((resolve 'clojure.contrib.pprint/pprint) x) | |
(print "\033[m") | |
(flush)) | |
(catch Exception e | |
(prn e))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment