Keyboard shortcut for Jump to Previous View Location (Navigate back/forward) in IntelliJ IDEA

Intellij IdeaKeyboard Shortcuts

Intellij Idea Problem Overview


I know Ctrl+Shift+Backspace is used to go to the location of the last edit.

But I want to jump to whichever location I was most recently at, not necessarily one where I edited anything.

For example, if I jumped to a declaration using Ctrl+B, then I want to go back to where I was before jumping.

Intellij Idea Solutions


Solution 1 - Intellij Idea

Alt + Shift + ← (Left Arrow)

or

Ctrl + E (Recent Files pop-up).

Also check:

Ctrl + Shift + E (the Recently Edited Files pop-up).

Mac users, replace Ctrl with ⌘ (command) and Alt with ⌥ (option).

Update In v12.0 it's Alt + Shift +← (Left Arrow) instead of Alt + Ctrl + ← (Left Arrow).

Update 2 In v14.1 (and possibly earlier) it's Ctrl + [

Update 3 In IntelliJ IDEA 2016.3 it's Ctrl + Alt + ← (Left Arrow)

Update 4 In IntelliJ IDEA 2018.3 it's Alt + Shift + ← (Left Arrow)

Update 5 In IntelliJ IDEA 2019.3 it's Ctrl + Alt + ← (Left Arrow)

Solution 2 - Intellij Idea

The underlying problem is Ctrl+Alt+Left and Right are used by window managers to switch workspace and/or OEM utilities to change the screen orientation.

You can change the assignments using File / Settings / Keymap then Main Menu / Navigate find Back and Forward and right click to Add Keyboard Shortcut to set an alternative key chord.

Alt Graph+Left and Alt Graph+Right works well for me (IDEA 13.1.4 on Ubuntu under IceWM).

Solution 3 - Intellij Idea

CMD + [ -> Go Previous

CMD + ] -> Go Next

==========

For OSX, cmd + [ and ] are the best choices to go back & forth, Since they are found so near to fingers, avoiding you wrist twisting a bit, one keypress lesser, ideal for users in vim mode.

As the OP requested, this works well with cmd + B which facilitates jumping inside/to the method/variable definition and comes back immediately using cmd + [. Give a try.

Solution 4 - Intellij Idea

For Ubuntu, Ctrl + Alt + Left and Ctrl + Alt + Right work fine.

By default these keys are assigned for Ubuntu's workspace navigation.

You need to disable that by going to :

System Settings > Keyboard > Shortcuts Tab > Navigation and disable Switch to workspace left and Switch to workspace right by pressing Backspace.

Or you can choose to change shortcuts in Intellij itself:

File > Settings > Keymap > Main menu > Navigate > Back/Forward

Solution 5 - Intellij Idea

Q & A is built into Intellij ...

CTRL/CMD + SHIFT + A x 2 TYPE caret

Solution 6 - Intellij Idea

For version 14. On mac, it is (alt) + +

Solution 7 - Intellij Idea

Mostly the default shortcut key combination is Ctrl + Alt + Left/Right. (I'm using the linux version)

Or you can have a toolbar option for it. Enable the tool bar by View -> Toolbar. The Left and Right Arrows will do the same. If you hover over it then you can see the shortcut key combination also.

enter image description here enter image description here

Just in case the key combination is not working (this can be due to several reasons like you are using a virtual machine, etc) you can change this default key combination, or you can add an extra combination (ex: For Back/Move to previous Ctrl + Alt + < or Comma).

Go to Settings -> select keymap (type keymap in the search bar) **-> Editor Actions -> search for back and find Navigate options -> change the settings as you prefer.

enter image description here

Solution 8 - Intellij Idea

OSX and Android Studio version:

CMD+ [ and CMD+ ]

to move to the previous carret location.

Solution 9 - Intellij Idea

In IntellJ 2017.2,

Ctrl+[ and Ctrl+] navigate between previous locations in the current file.

Ctrl+Alt+ and Ctrl+Alt+ navigate between previous locations in all files.

Solution 10 - Intellij Idea

Many excellent answers so far, and they do answer the question...But, if you don't want to have to deal with disabling graphics driver's settings, or creating new keyboard mappings, or are developing through a remote session (RDP) or within a VM that intercepts your keystrokes, good-old keyboard navigation still works. Just do Alt-N to bring up the Navigate menu and then hit the B key.

Please note that you don't hit all keys at the same time. So:

Alt-N wait B

This is what I use all the time, for exactly the case that the OP asked about. Also, this will probably hold through any IntelliJ updates.

Solution 11 - Intellij Idea

Depends on the Keymap selected.

Keymap: Mac OS X + Left Right Arrow Keys
Keymap: Mac OS X 10.5+ + [ / ]

I was facing similar problems in Pycharm. To resolve change your Keymap in Preferences.

Solution 12 - Intellij Idea

Navigate back/forward

Ctrl + Alt + Left/Right

Solution 13 - Intellij Idea

Using the following ways using only two keys will be the easier:

control + Tab

or

Alt + Left/Right

Solution 14 - Intellij Idea

For Mac users Use Command+[ for backward and Command+] for forward.

Solution 15 - Intellij Idea

You can use the below to navigate back in 2017.3.4

Alt + Left

Solution 16 - Intellij Idea

Like @itsneo said, I personally find + [ and ] the most convenient ones on a mac. But I can understand if you come from Linux side of things. Then you can use + alt + or .

Solution 17 - Intellij Idea

With version 2018.1 the keyboard short cuts for navigation are Shift+Alt+Left or Right

Solution 18 - Intellij Idea

If you are on a mac keyboard using with UNIX OS;

control + alt + command + left or right should work for sure.

Solution 19 - Intellij Idea

Press Ctrl + Alt + S then choose Keymap and finally find the keyboard shortcut by type back word in search bar at the top right corner.

Solution 20 - Intellij Idea

Intellij 2021.3.2 Basic Shortcuts

Ctrl+Shift+E = Recent Locations

Ctrl+E = Recent Files

Ctrl+N = Find the Class

Ctrl+Alt+B = Navigate the Class

Ctrl+Shift+T = Open the Test Class of the Class

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnkurVjView Question on Stackoverflow
Solution 1 - Intellij IdeaTomasz NurkiewiczView Answer on Stackoverflow
Solution 2 - Intellij IdeaSteve PitchersView Answer on Stackoverflow
Solution 3 - Intellij IdeanehemView Answer on Stackoverflow
Solution 4 - Intellij IdeaYogesh Umesh VaityView Answer on Stackoverflow
Solution 5 - Intellij IdeaEdward J BeckettView Answer on Stackoverflow
Solution 6 - Intellij IdeaPeiti LiView Answer on Stackoverflow
Solution 7 - Intellij IdeaprimeView Answer on Stackoverflow
Solution 8 - Intellij IdeaBresiuView Answer on Stackoverflow
Solution 9 - Intellij IdeaBen EllisView Answer on Stackoverflow
Solution 10 - Intellij IdeaRay N.View Answer on Stackoverflow
Solution 11 - Intellij IdeaShrikant GuptaView Answer on Stackoverflow
Solution 12 - Intellij IdeaYuliia AshomokView Answer on Stackoverflow
Solution 13 - Intellij IdeaVijendran SelvarajahView Answer on Stackoverflow
Solution 14 - Intellij IdeaSanthosh SurimaniView Answer on Stackoverflow
Solution 15 - Intellij IdeaRamakaView Answer on Stackoverflow
Solution 16 - Intellij IdeaSteveView Answer on Stackoverflow
Solution 17 - Intellij IdeaRiyafa Abdul HameedView Answer on Stackoverflow
Solution 18 - Intellij IdeassrpView Answer on Stackoverflow
Solution 19 - Intellij IdeaDmitry FedorovView Answer on Stackoverflow
Solution 20 - Intellij IdeaIbrahim Basha ImranView Answer on Stackoverflow