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 ?
Please sign in to leave a comment.
Navigate/Back (Ctrl+Alt+Left in default Windows keymap)
Thank you, answered :-)
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
@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.
@Andriy Bazanov
Thanks a lot, setting keymap helps!
Option + Command + Left in Mac OS X
In Ubuntu: Shift+Alt+Left for backwards and Shift+Alt+Right for forwards...
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.
It doesn't search for path + action name, unfortunately.
OK, thank you, I found it by searching for "Navigate" or "Back"; I didn't realize they were separated hierarchically.
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.
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;
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
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