Search code examples
pycharmkeyboard-shortcuts

In PyCharm how to go back to last location?


Edit: my system had global key map which had overridden PyCharm. Here's the original question:

I've tried these answers, but nothing happened: Keyboard shortcut for Jump to Previous View Location (Navigate back/forward) in IntelliJ IDEA

For example:

  1. I'm navigating to a function body,
  2. put the cursor on a function call,
  3. click F12 ("go to definition")
  4. from the new location (the function's body), how do I return to the function call?

I've tried these, but they didn't do anything:

  • Ctrl+Shift+Left
  • Ctrl+Shift+F2 <-- this is my default mapping
  • Alt+Shift+Left
  • Ctrl+Shift+backspace
  • don't try that on linux: Ctrl+Alt+backspace

Or maybe F12 ("go to def") isn't "strong enough" to trigger a location-change event?


Solution

  • All in all, it has nothing with PyCharm;

    In my case, there was a global key combo of another program, that masked Ctrl-Alt-Left

    I solve it by remapping "file > settings > keymap > main menu > navigate > back".

    I chose Alt+Left, which intuitively feels likes web browsers "back" behavior.