If you’re a Vim fan like me, probably you’ve already set your shell editor mode on
vi by appending this line to
~/.bashrc (or for ZSH users, like me,
set -o vi
But not all editors take this setup into account. One of the most revered REPL environments for Python people is IPython. The good news is IPython lets you opt to
vi shortcuts by just running it like this:
(Thanks to imiric for this great answer.)
If you’re using IPython as Django shell or you just want to make the setup above as a persistent default, open
~/.ipython/profile_default/ipython_config.py (if it was already there, otherwise read on), look for
c.TerminalInteractiveShell.editing_mode parameter and set it like this:
c.TerminalInteractiveShell.editing_mode = 'vi'
If you couldn’t find the file don’t attempt to create it by yourself. Just create it with this shell command:
ipython profile create
About Regular Encounters
I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course, textually minimal.