Skipping long entries for history search in IPython 5.x
<p>I use <code>ipython</code> console quite heavily for python workflow. As happy as I am with the new 5.x series <a href="http://ipython.readthedocs.io/en/stable/whatsnew/version5.html" rel="nofollow">released</a>, I find the ability to freely navigate inside the long code blocks a double-edged sword when it comes to history search.</p>

<p>For example, typing <code>import f</code> 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 <code>foo</code>:</p>

<pre><code>In [100]: import foo
     ...:
     ...: # copy-pasted code block that shows up in history
     ...: for foobar in foo.bar:
     ...:     pass
     ...:
</code></pre>

<p>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) <code>import foo</code> in history.</p>

<p>So my question is, is there a shortcut that allows to skip a long history entry to the previous one? Browsing history with <code>Ctrl+R</code> 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.</p>

<p><code>&lt;Up&gt;</code>/<code>&lt;C-P&gt;</code> and <code>&lt;Down&gt;</code>/<code>&lt;C-N&gt;</code> iterate over every line in your history.</p>

<p>Use <code>&lt;PageDown&gt;</code> and <code>&lt;PageUp&gt;</code> keys to iterate over entries instead.</p>

<p>Here's a full list of shortcuts: <a href="http://ipython.readthedocs.io/en/stable/config/shortcuts/index.html" rel="nofollow">http://ipython.readthedocs.io/en/stable/config/shortcuts/index.html</a>.</p>

python ipython keyboard-shortcuts