EditREPL is a port of Giles Bowkett's InteractiveEditor component from his ruby gem Utility Belt.
EditREPL allows you to run a terminal based editor inside your REPL session to interactively edit code.
Installation is easy using either pip or easy_install.
easy_install EditREPL pip install EditREPL
EditREPL is Python2 and Python3 compatible with the default interactive shell.
To include it in your session, import the module and call the editor function:
import editrepl vim()
After you save, the buffer will be executed in the current REPL context.
Yes, just call the editor function with the filename you want to edit.
vim("myfile.py")
By default it uses the editor defined as your EDITOR environment variable, but if that isn't defined it tries the following editors in order:
["vim", "vi", "emacs", "nano", "pico", "ed"]
To manually set your editor after initialization, supply the name or full path to the executable as follows:
ER.editor = "cli-textmate"
This will create a binding to the function cli-textmate for you to call.
Only the default python interpreter. iPython and bPython are confirmed to not work.
Check out the literate code here or clone the repo and checkout out the docs folder.
Contributors
- rpk512
Released under BSD License