How to go back to previous caret (text cursor) position?

Answered

Let's say I'm navigating by ctrl-clicking something and I get somewhere else in the same file ; how do I go back to where I was? In other words, how do I go back to the previous caret position ?

11 comments
Comment actions Permalink

Navigate/Back (Ctrl+Alt+Left in default Windows keymap)

19
Comment actions Permalink

Thank you, answered :-)

0
Comment actions Permalink

How do you navigate in the source code on MacOS then?

It was Cmd+[ or ], it does not work after I updated to Version 2017.2.1

2
Comment actions Permalink

@Liujialun10

1) What shortcuts do you have for "Navigate | Back" and "Navigate | Forward"?

2) Maybe you are using different Keymap?

3) Do you have any other actions associated with those shortcuts? Does IDE even registers them (e.g. maybe they are handled by OS-level actions).

Use "Preferences | Keymap" -- there is a button next to the search field -- it allows to find actions by currently assigned shortcuts -- use it and see if IDE will register them and what actions they linked to.

You may also change to use other shortcuts if so desired.

 

1
Comment actions Permalink

@Andriy Bazanov

Thanks a lot, setting keymap helps!

0
Comment actions Permalink

Option + Command + Left in Mac OS X

2
Comment actions Permalink

In Ubuntu: Shift+Alt+Left for backwards and Shift+Alt+Right for forwards... 

1
Comment actions Permalink

I'm on a Mac, and Cmd + [ or ] does nothing.

Searching in Preferences > Keymap > search box (left magnifying glass) for terms "Navigate | Back" and "Navigate | Forward" say "Nothing to show".

Command + Option + Left finds "Select Previous Tab" (and Right says "Select Next Tab") under Main Menu > Window > Editor Tabs.

If I search for "caret", it shows a bunch of caret options but I'm not seeing any that indicate to "go back to the cursor's previous position", which I need often especially in JavaScript.

Can someone just state the exact name of the feature so I can search for exactly that? I remember this was possible on Windows.

0
Comment actions Permalink

It doesn't search for path + action name, unfortunately.

1
Comment actions Permalink

OK, thank you, I found it by searching for "Navigate" or "Back"; I didn't realize they were separated hierarchically.

0
Comment actions Permalink

It looks like with 2019.2 the problem appeared again.

`Ctrl+Alt+ArrowLeft/ArrowRight` have no effect anymore.

Also, I can't find this setting in a `keymap` anymore.

1

Please sign in to leave a comment.