How to enable vi mode for several terminal applications on Unix (os X)

In order to enable vi mode for several readline-compatible (terminal) applications ilke ipython, MySQL, etc. on Unix (os X)

Set the following in your ~/.inputrc file:

set editing-mode vi
set keymap vi
set convert-meta on


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/; create it with ipython profile create if you don’t have it) with:

c.TerminalInteractiveShell.editing_mode = ‘vi’


python – How do I use vi keys in ipython under *nix? – Stack Overflow.

Leave a Reply

Your email address will not be published. Required fields are marked *