In my shell (zsh
) or in python
, I can go backward through command history by pressing PageDown, and I can go forward by pressing PageUp.
But in ipython
, these shortcuts are reversed.
Where are these shortcuts defined for ipython
, and how can I reverse them back, so that
PageDown goes back in history, and PageUp goes forward in history?
I am using ipython3
version 5.8.0
on Debian 10.
2
Answers
In IPython version 5.x, this is mentioned in the documentation: Specific config details — IPython 5.11.0.dev documentation
To get the function to bind to, see
key_binding/bindings/basic.py
: The default isSo, put this code in a startup file:
On newer IPython versions (such as 7.19.0) replace the
registry = ...
line withReference: Specific config details — IPython 7.19.0 documentation
Create script in
~/.ipython/profile_default/startup
directory with any name ending with extension.py
or.ipy
For example i created
history_keybindings.py
and put it inside~/.ipython/profile_default/startup
directoryNote: For more info check here