You can use vi mode editing in any program that uses readline
https://news.ycombinator.com/item?id=9055523With any program that uses readline, including psql, python and ipython, you can switch between vi and emacs editing by typing:
ctrl - alt - j
( C-M-j in emacs lingo)