Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add: Better clojure wrapper and clojure completion script.

  • Loading branch information...
commit 84454b0bbcc29cc529c49e20afff90c46d8310a4 1 parent 2cdf705
@gf3 authored
View
4 .inputrc
@@ -0,0 +1,4 @@
+set editing-mode vi
+tab: complete
+set completion-ignore-case on
+set blink-matching-paren on
View
26 .scripts/clj
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# clj - Clojure launcher script
+
+BREAK_CHARS="\(\){}[],^%$#@\"\";:''|\\"
+
+cljjar="/usr/local/Cellar/clojure/1.3.0/clojure-1.3.0.jar"
+cljclass='clojure.main'
+cljcompletions="$HOME/.clj_completions"
+
+CP=$CLASSPATH:${cljjar}
+CP=$CP:"/Users/gianni/Projects/clojure/clojure-contrib-1.3.0-SNAPSHOT.jar"
+CP=$CP:${PWD}
+
+# Add extra jars as specified by `.clojure` file
+# Borrowed from <http://github.com/mreid/clojure-framework>
+if [ -f .clojure ]; then
+ CP=$CP:`cat .clojure`
+fi
+
+if [ $# -eq 0 ]; then
+ rlwrap --remember -c -b $BREAK_CHARS -f $cljcompletions java -cp $CP $cljclass
+else
+ exec java -classpath $CP $cljclass $*
+fi
+
View
4 .scripts/generate-clojure-completions.clj
@@ -0,0 +1,4 @@
+(def completions (mapcat (comp keys ns-publics) (all-ns)))
+
+(with-open [f (java.io.BufferedWriter. (java.io.FileWriter. (str (System/getenv "HOME") "/.clj_completions")))]
+ (.write f (apply str (interpose \newline completions))))
Please sign in to comment.
Something went wrong with that request. Please try again.