Project tool window | context menu of a file | Compare File with Editor
Project tool window | context menu of two selected folders | Compare Two Files
This dialog is displayed every time you explore differences between files (local history for folders, recent changes, version control, local files and their versions on a remote host, or just comparing files). So doing, you can compare files of any types, including binaries.
You can also open the difference viewer without running PhpStorm. This is done through the following command:
<path to PhpStorm executable file> diff <path_1> <path_2>
path_2are paths to the files in question, which can be of various types, including
The differences viewer provides a powerful editor that enables code completion, live templates etc.
|Item||Tooltip and Shortcut||Description|
|Ctrl+C||Click this button to copy the line at caret in the right pane to the Clipboard.|
|Ctrl+F||Click this button to initiate Finding text procedure and locate the specified string in the current file.|
|or||F7 or Shift+F7||Click this button to move to next / previous difference.|
|Ignore whitespace||Use this drop-down list to define how the differences viewer should treat white spaces in the text.
|Compare Previous File
|Click this button to compare the local copy of the previous file with its update from the server.|
|Click this button to compare the local copy of the next file with its update from the server.|
|Highlighting mode||Select the way differences are highlighted. Possible options are: by word, by line, or no highlighting.|
|Click this button to simultaneously scroll both differences panes; if this button is released, each of the panes can be scrolled independently.|
|F1||Click this button to show reference page.|
|F4||Click this button to open in the editor a file from the active pane. So doing, the caret rests at the same character where it was located in the Differences viewer.|
|Click this button to reveal the drop-down list of available options (show or hide line numbers, indentation guides, white spaces, or soft wraps).|
|Ctrl+Tab||Use this keyboard shortcut to switch between the panes of the Differences viewer.|
|Use these chevron buttons to apply differences between panes.|
|Legend||Shows summary information about the encountered differences: number of differences found, and color map.|