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?

25 comments
Comment actions Permalink

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.

15
Comment actions Permalink

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

33
Comment actions Permalink

didn't work for me !

1
Comment actions Permalink

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"

6
Comment actions Permalink

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

11
Comment actions Permalink

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

8
Comment actions Permalink

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)

1
Comment actions Permalink

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!

1
Comment actions Permalink

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

3
Comment actions Permalink

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

0
Comment actions Permalink

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"

1
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

 

0
Comment actions Permalink

@Noexpresion

>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"

2
Comment actions Permalink

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

 

0
Comment actions Permalink

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 ? 

0
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

We unfortunately can't provide any estimates.

0
Comment actions Permalink

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

0
Comment actions Permalink

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

1
Comment actions Permalink

Alt + left worked for me

1
Comment actions Permalink

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.

0
Comment actions Permalink

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:

 

 

1

Please sign in to leave a comment.