Make PhpStorm show changed/modified files in project view - phpstorm

After moving from Zend Studio (ZS) to PhpStorm, I am starting to miss the way that ZS used to show changed files and display more than one project at once.
For example, notice how it shows that IndexController.php has been modified.
Is there any way to do this with PhpStorm?

Starting from PhpStorm 2022.1:
To highlight folders containing vcs changed files enable:
File | Settings | Version Control | Confirmation | Highlight directories that contain modified files in the Project tree
Older versions:
As mentioned in comment by LazyOne;
The Project panel does highlight any VCS changes,
but to also highlight all parent-folders of changed-files, enable:
File | Settings | Version Control | Show directories with changed descendants
All kudos to LazyOne!

Pressing Alt + 9 (not from numpad) you can get a panel with the changed files.

Go to file >> settings >> Editor >> General >> Editor Tabs.
Check Mark modified tabs with asterisk
Click ok

For PhpStorm version 2022.1.2, on MacOS Big Sur, you will need to go to:
Preferences -> Version Control -> Confirmation, then under Changes you will need to check the "Highlight directories that contain modified files in the Project tree" box.

Another alternative: ctrl + shift + e

To be more specifically. Under File Status (settings)
[option] Have changed descendants
[option] Have immediate changed children
[option] Modified
Change this three color

Another alternative : ctrl + e

PhpStorm store all the changes on your file. If you use Git or VCS it is easy to see what changes you have, but this is also availabe for normal local projects.
Open:
VCS -> Local History -> Show History
You will see the big windows divided on 2. Left showing all the versions, right all the modified files. Double click also gives you a diff windows, showing diference between both files.
All The modificationas are shown as a scalar one, means that selecting left the top one will show just last modification. Selecting in left the scond will show agregated modification since this time.
Let me know if you need more explanation.

As in PhpStorm 2021 you can achieve it by going to Settings > Version Control > Git and check Enable Staging Area

In a Git toolbar (ctrl+9) tab named Local changes

If someone is still looking for solution:
Go to View & look for Changes option, it should bring up the tree view of changes for current project.
You can also do show diff with current working tree in VSC pane.

Related

VS Code - How to stop it deleting whitespaces?

I am using Microsoft's VS Code to edit css, html and ts files that are shared by my team on a VSTS Git repo. However, my VS Code keeps removing empty/whitespaces that my colleagues added when I save any change (Image below) and this screws up the whole Git Diff part, as almost every single line of code shows as a diff.
I tried to disable every single config setup but nothings works:
At the end, what was causing my problem was the extension: EditorConfig for VS Code
This plugin attempts to override user/workspace settings with settings
found in .editorconfig files. No additional or vscode-specific files
are required. As with any EditorConfig plugin, if root=true is not
specified, EditorConfig will continue to look for an .editorconfig
file outside of the project.
I believe, it was overriding the options I selected inside of VS Code (such as files.trimTrailingWhitespace: false). So, no setup change I was making was actually being applied.
It seems you have trailing whitespace enabled in User Preferences too.
I'd suggest opening your configuration file of VSCode using
CtrlShiftP or
CmdShiftP in Mac and then go to Open User Settings.
I'm sure the next line is around there somewhere, delete it or change it to false.
files.trimTrailingWhitespace": true
In my case, the JS-CSS-HTML Formatter extension from lonefy
caused the problem.
Editor › Comments: Ignore Empty Lines
——>choose :false

PhpStorm navigate to -> file search only for Twig files

I have strange problem connecting with PhpStorm IDE. I use version 2016.3.2 Build #PS-163.10504.2.
I love using Ctrl + Shift + N for searching files which I need to override. I have 2 project (one new, one old) and in old file searching works fine and in new search only for twig files and nothing else.
Is there any configuration I need to change?
Check filter -- the blue Funnel icon on the right top corner of that popup -- you may have selected to list files of certain types only.
Otherwise -- try universal File | Invalidate Caches... and restart IDE -- it usually helps in such "suddenly stop working" situations.

Changing the default project directory in PhpStorm? [duplicate]

When I create a new project, I must edit the current project location each time, because our global projects are on:
~/Sites/
However, PHPStorm sets it default as:
~/PhpstormProjects/
How can I change the default location as mine?
There is no GUI for that.
PhpStorm should remember last used folder (when you successfully created new project) and use it by default for next one (does for me; although I'm using the same path since v1 .. maybe this was broken since then).
If it does not and if you have brave heart .. you can edit config file directly :)
PhpStorm v8 and earlier:
Close IDE
Open this file in any text editor: C:\Users\USERNAME\.WebIde80\config\options\ide.general.xml (path is for PhpStorm v8 on Windows 7; for other OS/versions please see this link: https://intellij-support.jetbrains.com/entries/23358108-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs )
File is very short -- just find <option name="lastProjectLocation" node and edit value attribute -- put desired path there
Save changes, Launch IDE and see if it worked for you.
PhpStorm v9 and newer: such setting is now located in recentProjectDirectories.xml file -- look for <option name="lastProjectLocation" value="LAST_PATH_HERE" /> entry.
There is a ticket asking for a GUI setting for this: https://youtrack.jetbrains.com/issue/WI-8839 -- watch it (star/vote/comment) to get notified on progress.
For default folder for "Open Folder" kind of dialogs -- follow IDEA-84622 ticket.
UPDATE 2018-05-25:
2018.2 will have a GUI field for that (Settings/Preferences | Appearance & Behavior | System Settings) -- see this comment.
Create the folder the you wanna use(Ex: /ProgramasBMO), and then go to:
1) File --> Settings (It will open a window)
2) Click on "System Settings"
3) Write the path to your folder
4) Done :)

PhpStorm multiple project navigation, quick switch between projects

How can I open few projects in left work area in PhpStorm? I need to quick switch between projects.
If you want to open more than one project in this way (and by this I mean so they have their own different settings), then currently it is not possible.
http://youtrack.jetbrains.com/issue/WI-15187 -- vote/star/comment to get notified on progress.
If you need to include files from those projects for reference purposes (to see how you have done it there, to copy some code from there etc) -- you can include them under "External Libraries" -- Settings | PHP | Include paths. Files included this way are protected from modifications.
If you need to modify those files ... you can add them into actual project as Additional Content Root (Settings | Directories| Add Content Root) -- such folders will be treated as part of the actual project with no separate settings.
Other than that -- Alt + Tab (or whatever the shortcut is on your OS) to switch between different PhpStorm windows (each project is opened in separate window/frame).
This is a right on time answer.
It is possible to quick switch between project by adding a keyboard shortcut to the "manage project" menu.
To do just that, go to Settings > Keymap and search for "Manage Projects". Then add it the keyboard shortcut you desire and you're all set.
Hope this will help someone looking for an answer like I did.
As LazyOne said, you can add paths to your project from Setting | PHP | Include paths or from the useful keystroke F4.
But I'd like to also share how I organise my projects, I think when you create a project, you should not open a new window but instead open it in the same window.
This way you don't get confused between the different opened windows.
In settings you can assign a keystroke to Reopen recent projects. I then use ctrl + shift + R but it is up for you to chose the keystroke you like.
Hope this will help you as I struggled as well to find a way to manage all my current projects.

IntelliJ IDEA compare tabs

I'm using IDE 10.5 Community edition.
In one project, I have multiple modules. I also have opened multiple tabs in the editor from different modules.
Is there a way to compare the content of two different tabs in the editor, which can be from different modules?
Select two files (with pressed Ctrl) in project view panel → Right Mouse button → Compare Files.
Right click on the file in project view → Compare With... (Ctrl+D)
If you have opened one file in editor you can navigate in project view to another file and press right mouse button on that file Compare with Editor.
It is possible to compare file against your clipboard content. View → Compare With clipboard
Also you can use idea as external diff tool idea diff file1.txt file2.txt
Outdated; Old verison of IntelliJ: Also you can compare files from 'Commander' tab, just select two files in right and left panels, right click on any of them → Compare two files
There is a plugin Compare Tab With Editor which may not have existed when this question was asked. I'm using it with IntelliJ 2017.2.
There is an updated version for IDE versions 2020.3 — 2022.1, Compare Tab With Editor 2.
One simple solution is the 'Compare with Clipboard' function (in your contextual menu - right click), which allows you to compare the contents of an editor tab with whatever is in your clipboard. As long as you can copy something, you can compare it against a file...
In 2019, select your file and "compare with editor" (which is your opened tab)
I use this to have a config file loaded in intelliJ (which is changed by the server, not stored in my project) and need to compare it to a baseline (in my project)