I use ipython console quite heavily for python workflow. As happy as I am with the new 5.x series released, I find the ability to freely navigate inside the long code blocks a double-edged sword when it comes to history search.
For example, typing import f and hitting the up key for history search completion now prompts the following to appear if there was a recent pasted code block that started with importing foo:
In [100]: import foo
...:
...: # copy-pasted code block that shows up in history
...: for foobar in foo.bar:
...: pass
...:
Now if you were simply looking for a one line import statement, and if the code snippet in history is sufficiently long, that's a lot of lines to navigate upwards before you can switch to an earlier (desired) import foo in history.
So my question is, is there a shortcut that allows to skip a long history entry to the previous one? Browsing history with Ctrl+R is an obvious workaround for this issue, but I'd like to know if there's a way to get it to work with the up key.
<Up>/<C-P> and <Down>/<C-N> iterate over every line in your history.
Use <PageDown> and <PageUp> keys to iterate over entries instead.
Here's a full list of shortcuts: http://ipython.readthedocs.io/en/stable/config/shortcuts/index.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With