Currently in Bash I use set -o vi
to enable vi mode in my bash prompt.
How do I get this going in ipython?
IPython bridges this gap, and gives you a syntax for executing shell commands directly from within the IPython terminal. The magic happens with the exclamation point: anything appearing after ! on a line will be executed not by the Python kernel, but by the system command-line.
Entering (and exiting) ipython You can also hit Ctrl-D to exit out of ipython. In fact, using your keyboard is the most highly recommended way.
You start IPython by typing “ipython” in your terminal. $ ipython Python 2.7. 2 (default, Jun 20 2012, 16:23:33) Type "copyright", "credits" or "license" for more information. IPython 0.13.
In case someone's wandering in here recently, IPython 5.0 switched from readline to prompt_toolkit, so an updated answer to this question is to pass an option:
$ ipython --TerminalInteractiveShell.editing_mode=vi
... or to set it globally in the profile configuration (~/.ipython/profile_default/ipython_config.py
; create it with ipython profile create
if you don't have it) with:
c.TerminalInteractiveShell.editing_mode = 'vi'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With