Search code examples
pythonpycharmconsolekeyboard-shortcutsjetbrains-ide

Console tabbing through previous commands in PyCharm


In PyCharm, using the Python console, I often press the up arrow to go through several previous commands. This is tedious if the commands are many lines long (for instance, the result of sending a long routine from a file to the console).

In IntelliJ, you can press Command + up to go to previous command without moving through all the lines of the current command. How can I do this in PyCharm?


Solution

  • You can use this functionality by configuring two keyboard shortcuts that are not set by default. Go to File > Settings > Keymap > Other and add the keyboard shortcuts right clicking on Next Entry in Console History and Previous Entry in Console History.

    screenshot settings keymap

    For the shortcuts to work you have to configure them before launching the console or press the Rerun icon in the console toolbar Ctrl+F5 if it's already running.

    You can also choose previous console history commands by clicking the Browse Query History Ctrl+Alt+E in the console toolbar.

    screenshot console history