IntelliJ IDEA compare tabs - 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)

Related

How can I configure sublime to always open to the same folder?

I have a folder that I want Sublime to always open to ...
my_folder
Is there somewhere I can set this so that when ever I click on the Sublime Icon it opens to this folder?
For some reason if I manually quit sublime text through the menu it will open my last folder on re-opening.
However, if I just click the close X button, it will not ... it will open a blank window.
Is there somewhere I can set this correctly in the JSON file?
Well not sure if you are aware of it, but ST has a quick switch project (usually ctrl+alt+p) that will show you your recently opened projects.
Of course it has its own drawbacks:
Unable to remove one instance from it without removing all (clear recent projects cache)Can’t open the project in a new window… instead it only replaces the current project
But AFAIK this would be the most optimal way to work with multiple projects. you just need to go to the folder of the desired project and open it once and it will be available as recent project in the future…
The point of having to choose where to save the project file, IMO is because you may want to share the same file with other people or just have them wherever you want… maybe having all in one place is good for you (it is for me as well) but other people might like to have it in separate folders. 
I usually work with the project replace window… or just go in “Project -> Open recent -> …” which opens a new ST window for me!
Hope this helps you

Go to file when file already open in other panes/windows open in Sublime 2

If I have several panes (groups) open and do CTRL+P (go to anything) and type the name of a file which is already open in another pane, Sublime will open this file in the pane I started Go to anything from. I want it to go to any of the other panes, where this file is already opened instead of opening a new instance of the file.
How can I achieve this?
There are a couple of packages/plugins that may be close to what you want:
GotoOpenFile, you can choose from a list of views in whole window or the active group:
https://sublime.wbond.net/packages/GotoOpenFile
or the newer Zen Tabs, which has some other useful file status as well as tab management
https://sublime.wbond.net/packages/Zen%20Tabs

How to associate a file with an editor in Fex

Within FlashBuilder it is possible to open a media file (such as an image) by right clicking on the file then selecting Open With and then choosing from a list of applications to open the file with the most appropriate editor. The trouble with this approach is that it is time consuming and has to be repeated whenever a similar file type needs to be edited from within FlashBuilder.
How can I associate a file (e.g. audio.png) with an editor (e.g. Photoshop) to permanently connect the file type with the application thus ending the process of selecting the application every time a similar file type has to be edited.
Go to settings under Window->Preferences->General->Editors->File Associations.
Add a new file type (Add button near top of dialog).
Add a new "Associated Editor" in the bottom portion of that dialog. (Second Add button towards bottom.)
Select "External Programs" after clicking "Add" to pick whatever program.
you can associate file types with your app by using the <fileTypes> tag in your descriptor-app.xml (read here). Or use NativeApplication.setAsDefaultApplication() (read here), However, you can not make another application the default in flex.
Flash Builder is just an Eclipse plugin.
Here are the instructions to do what you are asking in eclipse.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-51.xhtml
Associating editors with file types To associate editors with various
file types in the Workbench:
Open the command link General > Editors > File Associations
preference page.
Select the file type from the File types list, or click Add to add a
type that is not already on the list.
In the Associated editors list, select the editor that you want to
associate with that file type. To add an editor to the list:
Click Add. The Editor Selection dialog box opens.
Select Internal Editors or External Programs, depending on whether the editor that you want was built for the Workbench or runs outside
the Workbench.
If you select External Programs, you can click the Browse button to browse the file system.
Select the editor from the list and click OK.
Click OK to finish associating the editor with the selected file type.
When you associate an internal editor with a file type, that editor
opens in the editor area of the Workbench. For example, if you
double-click a file in the Project Explorer or an entry in the
Bookmarks or Tasks view it opens in the editor area.

Make PhpStorm show changed/modified files in project view

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.

How to edit preference file for Notepad++?

My open source project uses spaces, not tabs, in its code.
A contributor to the project has his own website which uses tabs, not spaces.
He uses Notepad++ in Windows to edit files for both projects, and is frustrated when he forgets to manually set the Preferences correctly and thus inserts tabs into my project's files.
Is there a way to edit this Preference via a script? That way he could click one icon to start Notepad++ in mode 1 (running a batch script to modify the Preferences file and then start the program) or click another to start in mode 2.
Or if there's any other way to make him not have to remember this chore, that would work too. Maybe having a Preferences setting that depends on what folder the edited file is inside of?
Any help would be appreciated. Thanks!
The notepad++ setting for replacing tabs with spaces is stored in following xml file
%USERPROFILE%\Application Data\Notepad++\config.xml
The following is the line that needs to be changed
<GUIConfig name="TabSetting" size="4" replaceBySpace="yes" />
Now I don't know how we can edit a file by batch script in windows, but if it is not possible, then he can keep two config files config-tabs.xml and config-spaces.xml. And in the script you can copy appropriate file depending on what he needs to work on.