ipython

Go to previous command without scrolling through multiline commands in iPython


I have the current newest version of iPython (7.6.1) and when I try to use the up-arrow keys to get to previous commands, when I hit a multiline command, the up-arrow instead slowly goes up through each line instead of going to the previous command. To get to the command before the multiline command, I have to scroll all the way up to the top of the multiline command before I can get to the previous command. Is there another shortcut I can use to skip the multiline command and get the previous one?


Solution

  • At least on a Linux machine, PgUp/PgDn appears to do the trick.

    If search for a particular item, partial entry followed by up/dn is nice. For example to find a previous function definition I might do

     def^p
    

    The ? help also suggests Ctrl + R for a history search. I haven't used that.

    The ipython shortcuts section refers to me to prompt_toolkit, but that gives info on setting things up, not on current options.


    In Macbook, you can use: