PhpStorm - Highlight active file in project navigator - phpstorm

Does anyone know how to highlight the current file in the project navigator, or a hotkey to expand folders to the active file?
I have looked around and couldn't find anything that points to this as an option.

Here is a nice feature: Autoscroll to Source and Autoscroll from Source.
It is available in all IntelliJ products .

On Demand
Should be used if you do not like when your Project View panel gets changed/moves without your consent.
Navigate | Select in... | Project View
Alt+F1, 1 for Windows/Linux
⌥+F1, 1 (or fn+⌥ Opt+F1, 1) for Mac OS
You may also click on "target like" icon on actual Project View panel with your mouse:
If you wish to use shorter/single shortcut instead of standard 2-step shortcut:
install "Extra Actions" plugin
assign custom shortcut to newly provided "Select in Project" action
As of some 2017.x version (or maybe even 2016.x) the IDE has own dedicated Select in Project View action (so no need for additional plugin). You can find it in Keymap under the Other branch (hint: use search box to narrow the list).
Automatically
Can be used if you do not mind (or even want) to have Project View panel keep focused on currently edited file (so it scrolls/moves up and down/expands when needed).
NOTE: with frequently switching between the files (e.g. CSS & HTML) when you have a lot of files in your project such "scrolling" may become quite annoying pretty fast (especially if such files are located in the invisible-right-now part of the project tree).
Activate Autoscroll from Source option in Project View panel (right click on tool window header bar/title or use menu under "gear" icon):
In modern versions (2020.3 and newer) that option was renamed and is now called Always Select Opened File:

Just click the circular icon (with tooltip Scroll from Source) to navigate in the project directory tree and highlight the corresponding active file in the PhpStorm editor.

On PhpStorm 2020.3 you have to click the cog icon in the project pane and select Always Select Opened Files:

The above answers are all valid but unfortunately you'll have to enable them for each project.
There's a plugin from Jetbrains that will enable this behaviour by default for all new projects.
http://plugins.jetbrains.com/plugin/7575?pr=

Related

Bin Icon is Gone From the Panel in Visual Studio Code

In Visual Studio Code, there was previously a trash image (icon) in the panel section. When I clicked on it the terminal was clearing. But it no longer exists. I changed accidently panel settings. For solving, I clearing settings.json folder but still same. Why does it never revert back to its old settings?
The Trash-bin Icon is Still Very Much Present in Your Editor
"The other solutions here, though no wrong in what they say, are not good solutions. The icon is still present if you know where to look, and you didn't accidentally change your settings. In the last VSCode update — "the May-2021 Update (v1.57.1)" — the VS-Code team added support for the new feature, "Terminal Tabs", which does more than add terminal-tabs, it offers users an entire new UI to use. It also switched the configurations of millions of unexpected VSCode users, so that the new UI was auto-equipped. In all fairness you are not the first person to wonder where the "Trash-bin Icon" went. I answered another question, 2 weeks ago, asking about the drop-down that is no longer visible."
You have two options available to you.
You can, keep the new UI the way it is, and below is a picture that shows where the new terminal tab trash-bin icon is.
Or you can switch back to the old UI using the setting bellow:
terminal.integrated.tabs.enabled: (true/false)
Image shows "terminal.integrated.tabs.enabled": false, and where the trash icon is. It is important to note that the icon auto hides, and one must scroll over it before it reveals itself.
Image shows "terminal.integrated.tabs.enabled": true, and where the trash icon is located using the old UI. I think its fair to note, the new UI was created to make VSCode better. People use to download extensions to get the same terminal tabs that the new UI offers.

PhpStorm single click preview like Sublime Text

At my new job I have to work with PhpStorm. I come from Sublime Text, and what bothers me most about PhpStorm is the lack of a single click preview of the files. In stead, it opens the files for editing and adds them to active tab, leaving me with A LOT of useless tabs.
I searched here on StackOverflow and Google, but I seem to be the only one who is annoyed by this. In Sublime it goes to edit mode only after a double click. Is there a setting or plugin to have it like in Sublime?
It's a native feature these days:
Settings... / Editor / General / Editor Tabs / Opening Policy > check "Enable preview tab"
on version PhpStorm 2022.3.2
Single Click To Open File
By default to open a file in phpstorm you have to double click it. I found this to be very annoying. Luckily you can change this to be a single click.
Steps:
Click the gear icon.
Make sure 'Autoscroll to Source' is checked
Make sure 'Autoscroll from Sourcce' is checked
http://www.ryanwright.me/cookbook/phpstorm/single-click-open-file
There is no such functionality currently available. I may only suggest to use View | Quick Definition to preview files.
Other than that: https://youtrack.jetbrains.com/issue/IDEA-130918 -- watch this ticket (star/vote/comment) to get notified on progress.
Welcome in late 2019 - we got a plugin for this now:
Plugin: https://plugins.jetbrains.com/plugin/12778-quick-file-preview
Plugin Source: https://github.com/SeeSharpSoft/intellij-file-preview
IntelliJ Issue: https://youtrack.jetbrains.com/issue/IDEA-130918
Don't forget to disable the "Autoscroll to Source" Feature, to get the full advantage of the plugin!
The closest you'll get right now is to enable 'Scroll To Source', however this will actually open the file in another tab, it will not be a preview.
Open the Project, Favorites, etc. side bar (cmd + 1 or ctrl + 1)
Click the gear in the top right
Select 'Scroll to Source'
Note 'Scroll to Source' can be enabled at the same as 'Scroll from Source', just make sure if you click on one file you wait until the sidebar catches up to click another, otherwise the sidebar will autoscroll back and forth between the two. You'll have to click one of them to break that loop.
Read more on JetBrains' website
This is now available as a native feature in the latest version: 2020.3!
See this comment on the YouTrack link someone posted above https://youtrack.jetbrains.com/issue/IDEA-130918#focus=Comments-27-4500169.0-0
Also on the 2020.3 feature list under User Experience there's a mention of "preview tab" here https://blog.jetbrains.com/idea/2020/12/intellij-idea-2020-3/

Linking project window with editor in PhpStorm

Is it possible to link project window/bar with editor? In eclipse there is button in project window called "link with editor". I would like to have exactly the same thing in PhpStorm.
Explanation:
Current active file opened in editor is automatically highlighted in project tree. If I change active file in editor to another, without even touching project window, it should change highlighted file as well. It should also keep current active file highlighted all the time if possible.
I didn't found such option in PhpStorm. If there is no such thing in PhpStorm, maybe there is plugin for that?
Just enable "Autoscroll from Source" in Project View side panel options (under "cog" icon or via right click on panel header/title)

How do you get Monodevelop back to using English for its language

I have no idea how it happened, but suddenly when I launch Monodevelop, the menus appear in a language other than English. I have tried reinstalling the application as well as manually removing artifacts in other directories under Library. No luck. After a reinstall, it loads in another language still.
You can change the Language under the options/preferences dialog.
For me the shortcut keystroke is 'command + comma'
Or it is the third menu entry under MonoDevelop menu.
Select the first child entry in the left tree view. "Visual Style"
On the right there are three tabs across the top. Select the first. "General"
The "User Interface Language" setting is the second combo box on that screen.
Change that and click OK at the bottom of the screen. Should be on the right.
Restart MonoDevelop.
Can you please open a bug on https://bugzilla.xamarin.com, including the Version Info from MD's about dialog, and attach your preferences file "~/Library/Preferences/MonoDevelop-2.8/MonoDevelopProperties.xml"?

How do I enable right-click (control-click) context menus in MonoDevelop?

Right Click (or control-click since I'm on a Mac) doesn't bring up the context menus for Solution or Projects.
For instance, in Visual Studio I would right click on a Solution to add a new project to the solution. I've looked all through the menu and can't find the add project command.
Also, how do I add a folder to a project? Again, this would be available from the right-click menu in VS, but I can't find it anywhere in MonoDevelop.
Control-click doesn't do anything for me in any part of MD. Not even in the text editor. Is there a setting to get it to behave the way I'm expecting it to?
Shouldn't these options also be available via the main menu also?
Apparently this was a known issue and has been fixed. It was a bug in the gtk+ library. Single button mice weren't supported.
https://bugzilla.novell.com/show_bug.cgi?id=359734
https://bugzilla.gnome.org/show_bug.cgi?id=346609
Still not sure why I'm seeing this bug now on my OSX 10.6.4 machine running the latest download of MonoDevelop.
Plugging in a 2-button mouse is an adequate work-around. I can right click and get the context menus I was looking for.
These features are where you would expect to find them, exactly where you said. The solution context menu contains Add > Add new project and the project context menu has Add > New folder
I'm on a macbook so I get to use the old double-finger tap, rather than CTRL+Clicking all the time. Not sure why the CTRL+Click is not working for you.
EDIT:
Control-Click anywhere in the solution explorer seems to bring up a context-sensitive context menu. Control-Click whilst solution is selected brings up the solution context menu and if a project is selected, the project context menu.
Control + click doesn't work but a two finger touch brings up the context menus on my Macbook Pro. Check your "Trackpad" settings in system preferences to see how you have secondary click setup on your mac.