Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use vi keys in ipython under *nix?

Currently in Bash I use set -o vi to enable vi mode in my bash prompt.

How do I get this going in ipython?

like image 494
gak Avatar asked May 01 '12 06:05

gak


People also ask

What is Ipython command?

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.

How do you escape Ipython?

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.

How do I launch Ipython?

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.


1 Answers

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' 
like image 124
imiric Avatar answered Oct 06 '22 01:10

imiric