396

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.

2
  • citing the source of jump to last edit location shortcut Commented Aug 2, 2020 at 12:22
  • The key does not work for remote in after some Microsoft update on Win 10, see here Commented Dec 10, 2021 at 14:28

21 Answers 21

540

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)

Sign up to request clarification or add additional context in comments.

21 Comments

Works like a charm ! My stupid video driver had configured these keys for screen rotation, had to disable that first. Could you also tell me the shortcut to a function definition within a class by typing the function name in a popup (like ctrl + n does for opening a class)
In v12.0 it's Alt+shift+left instead of Alt+Ctrl+left
Does anyone know how one can jump to the last view location if said location is in the same file as the current view?
Crtl + Shift + left, just turns my screen upsidedown :/
To disable some Intel grafics driver shorcuts on windows. Right click the desktop -> select Screen Resolution -> Click Advanced settings -> Click the vendor tab "Intel(R) ..." -> Hit the graphics properties or similar button -> Select Options and Support tab -> Disable Hotkey functionality.
|
125

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

5 Comments

Every system keyboard shortcut should include the super key to separate them from regular applications. Bad design. More Ubuntu conflicts: askubuntu.com/questions/412046/…
Thanks for mentioning the "Forward" and "Back" command names. This way I could easily remap them.
AltGr + Left/Right works for me out of the box in IDEA 2016.3.1 on Ubuntu.
This what i was searching longer time. Its the right fix. Thanks @Steve Pitchers
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['']" gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['']" How do I disable Ctrl+Alt+Left/Right?
80

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.

2 Comments

Also remember that "cmd + [" & "cmd + ]" are a popular pair in Chrome, iTerm, Firefox to go back & forth.
Nonetheless, all Jetbrains products have highly configurable keymaps, I would have configured Ctr+[ & Ctrl+] for this purpose, even in Windows or Ubuntu.
28

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 

Comments

15

Q & A is built into Intellij ...

CTRL/CMD + SHIFT + A x 2 TYPE caret

2 Comments

@StevePitchers You should see a modal window (bar) popup. Then type 'caret' or move caret to be precise... that will show all the caret movement shortcuts ;-)
@Eddie B. Thanks: I had also pressed Enter expecting a help browser to appear. The underlying problem is Ctrl-Alt-Left and -Right is used by window managers to flip panes and/or OEM utilities to change the screen orientation. I will add an answer...
14

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

Comments

11

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

Comments

8

OSX and Android Studio version:

CMD+ [ and CMD+ ]

to move to the previous carret location.

Comments

6

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.

Comments

6

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.

1 Comment

is the previous location in current file still supported? What's the name of that action?
5

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

control + Tab

or

Alt + Left/Right

Comments

5

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.

Comments

4

Navigate back/forward

Ctrl + Alt + Left/Right

Comments

4

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

Comments

3

You can use the below to navigate back in 2017.3.4

Alt + Left

Comments

3

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.

Comments

3

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

Comments

2

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 .

Comments

1

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

Comments

0

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

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

Comments

0

For anyone who cares:

IntelliJ 2025, you can customize your Toolbar. enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.