cosmin / IClojure

A better Interactive REPL for Clojure
http://www.iclojure.com
Eclipse Public License 1.0
115 stars 11 forks source link

open $EDITOR with %edit-like command, returning the contents to the repl #3

Open manniche opened 12 years ago

manniche commented 12 years ago

For longer ipython-sessions, I regularly use the %edit functionality, which opens an editor (defined in $EDITOR) and upon closing the editor, returns the contents in a string to the interactive shell.

With python, the functionality is really nice when needing to insert custom classes in your ipython session, those indentations are much more easily managed in a sane editor than in the shell. The same is the case for me when trying to keep track of the parentheses.

See http://ipython.org/ipython-doc/rel-0.12/interactive/tips.html#lightweight-version-control for reference.

cosmin commented 12 years ago

I agree fully, and support for %ed is at the top of the list of what I want to implement. The problem currently is that in Java this is much harder to do than in Python due to limitations of the JVM. While I can execute a process for the editor it won't be attached to the TTY. This means you wouldn't be able to open up Vim or Emacs in the terminal. It would work if $EDITOR was set to something that would launch in a separate window (such as TextMate), but that's far less useful for me.