What is the use of autoscroll to source and and autoscroll from source features in Intellij IDEs? - intellij-idea

I was looking for how to show the open files in project view and found theses two features, I want to know what does the above mentioned features do?

Explaining this simply,
Autoscroll to Source
Whenever you click on a file name in the Explorer Window, the file will be brought into focus on the editor. If the file is not open, it will be opened.
Autoscroll from Source
If you select a file in the Editor, that fill will be scrolled to and highlighted in the Project Explorer.

From the manual,
Autoscroll to Source
If this option is on, IntelliJ IDEA automatically navigates from a file (or a class member) selected in the Project tool window to the corresponding source file (or its fragment) in the editor. If the corresponding file is not currently open, it will open automatically.
Autoscroll from Source
If this option is on, IntelliJ IDEA automatically navigates from a file in the editor to the corresponding node (file, class, field, method, etc.) in the Project tool window.
https://www.jetbrains.com/idea/help/project-tool-window.html

Related

Intellij vcs plugin, view changed files AND file changes in the same window

I normally do git diff for this but want to leverage the intellij gui.
The Version Control tab just shows me all the files that changed:
To view the actual changes I have to select a file and choose "Show Diff".
This opens another window. Now from this other window if I want to see changes for another file I have to click this button then open the other file:
I don't like that. Is there a way to have this in the same pane? Where on the left I see a list of the changed files and I just have to select the file to see its changes? Otherwise its very clunky and unusable for being able to see a tree of changed files and selecting the one's changes I want to see
Just found it, I wanted "preview diff"

How do you configure IntelliJ IDEA to place the cursor in the editor window after hitting enter on a file in the project window?

I'm big on not using the mouse, especially while writing code. I've noticed in IntelliJ IDEA 2016.1 that when I'm navigating in the project window, hitting Enter while a particular file is selected opens the file in an editor, but it doesn't place the cursor in the editor. Interestingly, if I double-click on the file in the project window, the cursor is placed in the editor.
How do I configure IntelliJ to place the cursor in the editor after opening the file via Enter from the project window?
To the best of my knowledge, I do not believe there is a way to configure what you are looking for. A search for focus in the settings didn't turn up anything.
That said, hitting Esc when in the project view will return you to the editor. So you would need to do Enter, Esc. If having to type two keys in a row bothers you, you could always record a macro (Edit > Macros) to do that key sequence and map it to a shortcut.

Using file templates in IntelliJ

I'm quite confused when it comes to file templates in IntelliJ. Basically, when I right click anything and hover my mouse over to New, I can see the usual file templates like Java Class, HTML File and so on. I downloaded Scala plugin and I can see Scala templates (Scala Class, Scala Object, etc.) if I go to Edit File Templates, but I can't actually use/see them in the New menu. Is there a way to modify what I see in the New menu? I'd like to be able to create Scala classes.
Go to Settings -> Menus and Toolbars
There you will see many type of menus. You need edit the menu you want the files to be displayed. Most Probably "Project View Popup Menu".
Click on "Add After" button on right. There you choose the file form plug-ins or other category to be displayed.
I added "Show Bytecode" to meny well it does not make sense here. You can add files from scala plugin like that.
You can restore to Defaults if you mess up easily by clicking on
"Restore All Defaults" button.

One-click file opening in AppCode like in Xcode

Can we set AppCode to open a file with one click? The default is two click like on non-macOS systems.
It would be more natural for those used to opening files with one click in Xcode.
In the gear menu for your project, select 'Autoscroll to source'. From the documentation:
If this option is on, AppCode automatically navigates from a file (or a class member) selected in the Project tool window to the corresponding source file (or its fragment) in the editor. If the corresponding file is not currently open, it will open automatically.

Highlight file opens up file in a preview window functionality instead of double click

Coming from a Visual Studio environment and Xcode environment, if you highlight a file on the project window (LHS), the file opens. IntelliJ doesn't open a file until you double click it.
It's kind of a different feel since it opens it up in a new tab each time vs just using the last active window or a preview window to flip between files. Is there a way to make it more like VS or Xcode that where highlighting the file actually opens the file in the current window?
There is Autoscroll to Source option in the project view settings. Unfortunately it doesn't open the focused files in the current tab, but in new tabs.
I haven't found an option to change this behavior anywhere, but there is already a feature request on IntelliJ's YouTrack asking for this, so feel free to vote for it :)