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?

27

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

24

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

75

didn't work for me !

3

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"

12

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

22

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

17

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)

0

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!

3

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

4

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

0

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"

2

@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

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

0

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

@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

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

 

3

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

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

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

0

We unfortunately can't provide any estimates.

0

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

0

@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

Alt + left worked for me

1

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

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

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

1

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

0

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

0

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

 
 

 

 

2

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

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

0

请先登录再写评论。