1. 通过以下命令生成配置文件:
ipython profile create
2. 编辑修改生成的配置文件(~/.ipython/profile_default/ipython_config.py):
## Shortcut style to use at the prompt. 'vi' or 'emacs'.
c.TerminalInteractiveShell.editing_mode = 'vi'
## Set the editor used by IPython (default to $EDITOR/vi/notepad).
c.TerminalInteractiveShell.editor = 'vi'
3. 重启ipython生效.