165

I can't find a hotkey for the feature "Scroll from Source".

What is the difference between Scroll from Source and Scroll to Source as well?

Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
mjs
  • 21,431
  • 31
  • 118
  • 200

11 Answers11

263

In the latest IntelliJ IDEA, there is a keymap entry called "Select in Project View" with no default shortcut. Just add a shortcut key to it. No need for a plugin.

Keymap|Select in Project View

Pang
  • 9,564
  • 146
  • 81
  • 122
George Dimitrov
  • 3,139
  • 2
  • 17
  • 6
170

tldr; Alt + F1, then 1

First checkout your shortcut key for the "Select In.." item in the Navigate menu.

MBP Intellij Menu

Click in the file you're editing, hit the shortcut key for "Select in".. then press 1.

I've changed the hotkey for select in to Alt + 1 so that my key combination is the easy to remember Alt + 1, 1

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
chim
  • 8,407
  • 3
  • 52
  • 60
28

There is a plugin for this now.

It's called Scroll From source:

https://plugins.jetbrains.com/plugin/7606?pr='


This is now builit in see @Dimitrov answer

https://stackoverflow.com/a/42025214/961018


mjs
  • 21,431
  • 31
  • 118
  • 200
15

There's no configurable shortcut in the Keymap settings, and it does not appear in the "Enter action" dialog, so I'm pretty sure it's not (yet) configurable, even if I agree it would be very appreciable.

Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
12

You can use the navigation bar Shortcut keys as well.

On Mac

Hit + (command and up key)

Hit (left arrow)

Hit + Enter

This will take you to the folder in project view.

It's worth having a play round with the navigation bar.

IntelliJ really have this covered :)

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
chim
  • 8,407
  • 3
  • 52
  • 60
7

For ubuntu i did ALT+L (cause ALT + F1 is busy), then just enter.

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
Vadim
  • 1,131
  • 17
  • 16
  • This is a better answer. Even though it is two steps it doesn't require any installed plugins. This also works on mac (Option+F1). – Elliot Chance Jul 28 '16 at 23:31
  • Could you tell what's the name of the action? This shortcut does nothing for me. – topr Jul 24 '17 at 08:55
  • seems like they removed that from Idea. cause I can't find it in my settings any more. but it still works. – Vadim Jul 25 '17 at 12:04
  • Alt+F1 is dash home in GNU/Linux, so doesn't work on it. I found that Alt+Z is already set as another shortcut for 'Select In...' in my Idea 15.0.6 – Champ Sep 06 '17 at 17:38
6

If you are using JetBrains Rider, then the shortcut is Locate in Solution Explorer:

enter image description here

Tarik
  • 79,711
  • 83
  • 236
  • 349
2

As a much much much much much better alternative to the scroll from source functionality you can use the Navigation bar.

Note: double clicking on the folder in the navigation bar will scroll to that folder in the Project view, (i.e. the same functionality as scroll from source).

You can show the navigation bar in the view menu, there's also a shortcut for each OS (cmd and up arrow ⌘ + ↑ on OSX, Alt + Home on Linux and Windows)

So it looks like this...

enter image description here

And it allows you to browse through the folder structure containing the file in focus in the main editor.

https://www.jetbrains.com/phpstorm/help/navigation-bar.html

https://www.jetbrains.com/idea/help/navigation-bar.html

https://www.jetbrains.com/webstorm/help/navigation-bar.html

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
chim
  • 8,407
  • 3
  • 52
  • 60
  • There is actually a plugin for scroll to source now. See new answer. – mjs Nov 06 '15 at 12:14
  • Ah, great momo, nice find. I've upvoted your new answer. Not sure I'd swap though since I've discovered the navigation bar which allows me to open all nearby files and more, whilst keeping where I am in the Project view. – chim Nov 06 '15 at 14:59
  • Still occasionally need scroll from source, but navigation bar is better :) – chim Nov 12 '15 at 15:25
  • Actually the one thing I was using scroll from source for you can do more easily with the navigation bar. (Right click the folder in the navbar and find in path is there along with all the other options). And as you can see every folder back to the project root it's so much better. – chim Nov 13 '15 at 16:09
  • 1
    That might be not obvious. Double clicking on directories in the navigation bar does the same as "Scroll from source". – ya.teck May 16 '16 at 11:53
  • Do you mean "*This* might not be obvious". But that's awesome as well :) (Awesome that double clicking on the folder does the scroll from source) – chim May 16 '16 at 13:45
  • @chim this is indeed help full but not so awesome at all when the key point is NOT to click at all but use keyboard only. Any further tips how? – topr Jul 24 '17 at 08:54
  • @topr yes absolutely it doesn't address the original post directly, helpful is cetainly a better way to describe it rather than awesome. – chim Jul 24 '17 at 11:44
2

In Ubuntu 18 you can disable shortcut Alt+F1, the super key(windows key) do same thing.

At moment i disable/changed this shortcuts of ubuntu

Alt+F7 --> windows+F7
Ctrl+Alt+L --> windows+L
Alt+F1 --> windows

Another better way:
The Shortcut is called Select in Projec View
The default shortcut is

CTRL+Alt+1

or you can edit this.

Source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206717285-Scroll-from-source-keyboard-shortcut-?flash_digest=77b77d09d61eff96f7d59697820dee45b2c2041c

UPDATE: Now you can easylly use Shift+Alt+1 in Gnome Keymap or Alt+F1 in Windows Keymap

Blockquote

1

If I understand correctly you don't want to toggle the option so much as trigger the file browser tool window with the selection being the currently edited file.

Just leave 'Scroll From Source' enabled and open the file browser with Command + 1 on OSX or CTRL + 1(i think) on Windows. The file browser sidebar will be selected and your selection will be highlighted.

This answer also explains the difference between Scroll To and Scroll From: How to make Scroll From Source feature always enabled?

Community
  • 1
  • 1
stealthwang
  • 915
  • 6
  • 8
  • 8
    I don't want it enabled all the time. I want to use a hotkey, instead of taking my mouse to the menu and clicking the button. I use command + 1 all the time, I know I can turn on scroll to and from, but I don't. I want to navigate to the file on my command, otherwise I keep loosing context and a huge tree that is expanded all the time, doesn't work. There is a button to scroll with the mouse, what is the hotkey for that? – mjs Jul 31 '14 at 18:02
0

In JetBrains Rider, this action used to be named Locate in Solution Explorer, but is now (v2019.2) named Locate/Select in Solution View and by default (at least with the built-in ReSharper keymap) bound to Alt+Shift+L.

Cocowalla
  • 13,822
  • 6
  • 66
  • 112