I am not looking for an IDE or integrated REPL. I just wanted to ask if someone knows if it is possible to have a buffer editor in the REPL as know from 'psql' or some *nix shells.
In psql for example you just enter "\e" and you'll get the last command in your EDITOR and uppon exit it gets executed.
This would be awesome for clojure repl.
$ java -cp jline.jar:clojure-1.3.0.jar jline.ConsoleRunner clojure.main
So, is there such a feature? Where would it have to be implemented, in jline?
Solution:
rlwrap does the trick.
I had to compile readline ftp://ftp.gnu.org/gnu/readline/ and then rlwrap http://utopia.knoware.nl/~hlub/rlwrap/#rlwrap.
After that I could use the following shortcut to start the editor.
Ctrl + ^
rlwrap -m -- java -cp clojure-1.3.0.jar clojure.main
For the use with leiningen on Mac OSX I had to change the following:
lein 1.6.2
*** 226,233 ****
rlwrap -m -q '"' echo "hi" > /dev/null 2>&1
if [ $? -eq 0 ]; then
RLWRAP="$RLWRAP -r -m -q '\"'"
- else
- RLWRAP="$RLWRAP -m --"
fi
fi
fi
--- 226,231 ----
and export RLWRAP_EDITOR
export RLWRAP_EDITOR="vim +%L"