130

How to enable "Scroll from source" in IntelliJ IDEA so it is always on, meaning if you open any file it is automatically shown in Project view, likewise it is made in Eclipse?

There is a possibility to click the button in Project to find chosen file, but it is annoying to click it each time you open another file.

Eugene
  • 59,186
  • 91
  • 226
  • 333

4 Answers4

201

You can check Autoscroll from source in setting for project pane (in the lastest version is probably different icon)

enter image description here

chalimartines
  • 5,603
  • 2
  • 23
  • 33
  • 5
    Thank you so much. This has been my biggest problem with moving from Eclipse to IntelliJ – Arthur Nov 21 '13 at 11:14
  • 1
    @EatatJoes -- in VS go to Tools -> Options -> Projects and Solutions -> General and enable the checkbox "Track Active Item in Solution Explorer". – Tomas Karban May 16 '14 at 00:35
  • "Autoscroll to Source" makes sense to me (I think), what does "Autoscroll from Source" mean? – bergie3000 Jun 06 '14 at 20:23
  • 14
    Autoscroll To Source means a single click in the project tree opens/jumps to that code window. Autoscroll From Source means when you switch to a different code window the project tree will jump to/highlight that file. – CodeChimp Jul 19 '14 at 08:27
  • 6
    not sure if I'm the only one, but those two autoscroll features don't always work. – Gubatron Feb 20 '15 at 04:00
  • For me this solution only works when I switch between file tabs. When I open a new file using Open File och Open Class nothing happens! – bjorns Apr 09 '15 at 08:10
  • The image link is gone :( – Henrique de Sousa Sep 15 '16 at 14:39
  • I can still see it. Wasn't that only some temporary stackoverflow issue? – chalimartines Sep 15 '16 at 18:40
  • @Gubatron I encountered same issue. I had pending plug-in installs. I reset layout defaults and once I installed pending updates and had it restart then it worked. Previously just restarting editor did not work. – Douglas Drouillard May 21 '17 at 13:37
  • @Gubatron The 'from source' features is totally unreliable for me. – Lyuboslav Jun 02 '17 at 13:40
36

Unfortunately this setting must be ticked every time you open or create a new project.

If you would like this setting to persist between projects, you can use this plugin:

AutoScroll Save IntelliJ Plugin

Disclaimer: I am the plugin author.

vikingsteve
  • 38,481
  • 23
  • 112
  • 156
14

From version 2019.3.1, the name of the options have been changed as below:

Autoscroll to Source -> Open Files with Single Click

Autoscroll from Source -> Always Select Opened File

The credit will go to this post. Hope it helps.

Eric Tan
  • 1,377
  • 15
  • 14
  • After reading this answer, the new wording seems more user-friendly. But as a long time Intellij user, I was specifically looking for the familiar "scroll from source" and my mind basically just skimmed past this. Thanks for pointing this out! – mindreader Oct 19 '20 at 18:50
2

I'm using 2019.3 and I could not find the gear icon, or Autoscroll or Open Files in the Settings.

Here's what I did instead, after 30 minutes of searching.

  1. Right click on the Project
  2. Enable "Open Files with Single Click"

enter image description here

No One
  • 553
  • 2
  • 9
  • 24