Way to jump back to previous file/line after Ctrl+clicking function call?

I frequently have to jump into function call on a line, which takes me to a different line or file, and it's not easy to go back to the line I clicked from, so is there a keyboard shortcut or something that will take me back?


Hi there,

Many options -- choose which one works best for you:

  • Navigate | Back
  • Navigate | Last Edit Location
  • View | Recent Files
  • Ctrl+Tab (switch to the last (most recent) tab -- similar how Alt+Tab works)

Just check what shortcuts those actions have on your OS / your Keymap (most likely it will differ to what I have here on Windows using Default keymap).


Ctrl+alt+left arrow to go back to previous location and Ctrl+alt+right arrow to go forward.


didn't work for me !


Cccabdalla, are you using macOS? If so, it's a different shortcut there: Cmd+Alt+Left/Right.
You can check the shortcut in Settings/Preferences | Keymap | Search for action "Back"


Turns out the keyboard shortcut on Mac to "Navigate Back" is ⌘[


On Linux at least Navigate | Back is Alt+Shift+Left Arrow


On Linux, use Ctrl + Alt + Left Arrow/Right Arrow to retrace your jump history seamlessly. Note that even when you use Ctrl + Tab, you can use the above shortcuts to navigate through the jump history. If the above shortcuts don't work the shortcuts must have been allocated to some OS level function. (Using CLion v2017.3 on Ubuntu 16.04)


If you have a mouse that has back and fore buttons (Like a gaming mouse or so) whenever you CTRL + CLICK to go to a definition(even if it is in another file) by clicking the back button in your mouse, it will take you to the previous place where you were (And it also has a history so that you can navigate back and fore between places)

It's pretty cool, you should try it!


Ctrl+Alt+Left Arrow (for the default key map)


Cmd+Alt+Left/Right is no longer working on OS X. Is it a bug?


Still works for me. Please check if the shortcut set for you:

> You can check the shortcut in Settings/Preferences | Keymap | Search for action "Back"


@Anshumandhuliya Thanks for your comment. Using Linux Mint 18.3 Sylvia, the default OS mapping for Ctrl+Alt+Left/Right is to switch workspaces. I just changed those keybindings to Ctrl+Alt+4/6 and the Ctrl+Alt+Left/Right works in JetBrains now.


Can confirm that the Mac shortcut is still cmd]+[ for back and cmd+] for forward


The problem with the keys combination is that, if they are configured to by default to do something by the operating system, they won't do what IntelliJ wants them to.

Go to the View menu and check the 'Toolbar' option. Then you will see the back and forward navigation arrows somewhere in the left part of the upper bar. These will work on all operating systems and you won't need the keyboard combination anymore.




>The problem with the keys combination is that, if they are configured to by default to do something by the operating system, they won't do what IntelliJ wants them to.

How about assigning your own shortcuts that are suitable to you and your OS?

"Settings/Preferences | Keymap"


You can use Shift + Alt + Left Arrow it worked for me in IntelliJ and my os is Ubuntu



The problem is that when I jump back from some file it doesn't close the opened file it visited , which leaves many files open and requires manual cleanup , is there a way to automatically close files when jumping back ? 


Nikolai Orenstrakh, there is a request for ignoring closed files completely, but no request for closing files while you move between them.
Please submit a new one: https://youtrack.jetbrains.com/newIssue?project=WI


hmmm , this request https://youtrack.jetbrains.com/issue/IDEA-157301 is opened since 2016 :) what are the chances my request will get priority ?


We unfortunately can't provide any estimates.


What is the short cut in Ubuntu 18.04 ... here in ubuntu Alt + Shift + ctrl + Arrow keys will switch between workspaces


@Kalanka Siyambalapitiya

It depends on your Keymap used in IDE.

Please check the list of actions in my very first comment and look what shortcut it has, e.g. "Main Menu | Navigate | Back"

If you want to change that shortcut to some another, you can do it via "Settings (Preferences on Mac) | Keymap"


Alt + left worked for me


I am using Ubuntu 16.04. The Ctrl+Alt+Left navigation was not working for me.

Originally I had keycombo Ctrl+Alt+Left AND mouse Button4 assigned.

I assigned keycombo Cltr+Alt+Left once again. (It appeard as 3rd in the list).

It was not working.

I removed the first keycombo from the list.

And that was the point when it started working.

I suspect that though it renders as Ctrl+Alt+Left, it actually refers to a key/keycode that is never triggered on linux. One way would be that it actually refers to one of the LEFT/RIGHT Ctrl and Alt keys, but it is not displayed.


I am using Linux Mint and a Gnome Desktop. So now i use default gnome keymap and then Alt+Shift+Left and Alt+Shift+Right is used to navigate to previous/next location. 

I think Ctrl+Alt+Left in Gnome is used to move between workspaces.

Change keymap in intellij under settings:




CTRL+ALT+LEFT doesn't work via RDP. I had to assign another combination.


Ubuntu 18, PHPStorm 2019.2.

Shortcut for Navigate | Back is Alt+Shift+Left, but actually it switches to left tab (which shortcut is Alt+Left).

Tried to reassign Alt+Shift+Left, but for some reason Storm doesn't see I press Shift with Alt or Ctrl. So I assigned Alt+Left to back and unassigned it from left tab shortcut (as far as I don't use it).


@Kumarasamy Ramasamy thanks. It worked well in android studio as well


As others mentioned. It depents on OS & keymap.

For Ubuntu 18.04 and "gnome" keymap (check out or set up your keymap with Ctrl+Shift+A and search for "keymap") which is default, it is:

Shift + Alt + Left Arrow (resp. Right Arrow) to look one navigation back (resp. forward). @Alazankin said this shortcut shadows Alt+<Arrow> which does not (check your keymap).





Thanks Andriy Bazanov , the Navigate|Back suggest the short-cut is command+[

works fine for me , exactly what i was looking for.


Please sign in to leave a comment.