in pycharm, how to go back to last location

2019-02-04 04:17发布

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??

标签: pycharm
9条回答
Emotional °昔
2楼-- · 2019-02-04 04:23

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.

查看更多
疯言疯语
3楼-- · 2019-02-04 04:23

Update for year 2016 & 2017:

In PyCharm 2016 & 2017 on windows the correct default is CTRL+SHIFT+BACKSPACE

https://www.jetbrains.com/help/pycharm/2016.2/navigating-to-next-previous-change.html

Be warned that CTRL+ALT+LEFT_ARROW will rotate your entire screen on windows 10. If you're reading this from a horizontal posture, CTRL+ALT+UP will get you back vertical!

查看更多
我只想做你的唯一
4楼-- · 2019-02-04 04:23

On macOS (Sierra; 10.12.6) and PyCharm 2017.3.1 (Professional Edition; built on December 13, 2017), if you're using the Go To -> Declaration (⌘+B), you can jump back and forth using ⌘+⌥+◀ or ▶.

查看更多
别忘想泡老子
5楼-- · 2019-02-04 04:29

Alt + Shift + left

The above works with pycharm2016.3.2 if you select the keymap "default for GNOME".

查看更多
看我几分像从前
6楼-- · 2019-02-04 04:29

I found the solutions doesn't go with mac. But I found that

Shift + Command + Return 

takes to you location that you were working with.

To further explain, If you have pressed + to navigate to a function, pressing the above combination takes to directly to the call.

查看更多
小情绪 Triste *
7楼-- · 2019-02-04 04:36

Under ArchLinux with PyCharm CE 3.1 works the combination Ctrl + Alt + Left.

This is the way I find out the combination:

  1. (Right click) Go To -> Implementation(s)
  2. Double Shift -> Back
    enter image description here
  3. There is an option Back in the section Actions
  4. Ctrl + Shift + A
    enter image description here
  5. And then the cursor comes back
查看更多
登录 后发表回答