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 ?

10
14 comments

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

29
Avatar
Permanently deleted user

Thank you, answered :-)

0
Avatar
Permanently deleted user

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

5

@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.

 

3
Avatar
Permanently deleted user

@Andriy Bazanov

Thanks a lot, setting keymap helps!

0
Avatar
Permanently deleted user

Option + Command + Left in Mac OS X

3

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

3

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

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

1

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

0
Avatar
Permanently deleted user

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

The setting can be found by word 'back' in keymap. I found 'Ctrl+Alt+Left' but somehow this keyboard shortcut rotate my screen. So I just edited it to another shortcut;

0

In my case it was

Alt+Shift+ Left Arrow (for back navigation)

and

Alt+Shift+ Right Arrow (for forward navigation)

Working on following build:

------------------------------------

WebStorm 2020.3.2
Build #WS-203.7148.54, built on January 25, 2021
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 4.15.0-136-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1900M
Cores: 8
Current Desktop: ubuntu:GNOME

1

Ctrl+Alt+Left/Right didn't work on my Ubuntu 20.04 because it was secretly (not in Keyboard Shortcuts) used by Ubuntu for workspace switching.

Here's an explanation and a fix: stackoverflow answer

0

Please sign in to leave a comment.