Phpstorm сравнить два файла
Речь в статье идет о последней на момент ее написания версии, восьмой. Так же я использую PhpStorm на Windows, поэтому и все хоткеи буду писать с упоминанием Ctrl и Alt. Если у вас Mac, скорее всего вместо них можно жать CMD, либо придется порыться во вкладке Keymap настроек.
Compare any text sources
Apart from comparing files' or folders' contents, you can open an empty Differences Viewer and paste any text or drag files into the right and left panels to compare. This can be useful, for example, if you want to compare an application's console output with the output of the same application albeit a little modified.
Press Ctrl+Shift+A and start typing to locate the Open Blank Diff Window action.
Paste any text you want to compare in the left and right panels.
Переключение проектов
Стандартный механизм переключения проектов не слишком удобен. Я советую использовать Frame Switcher для быстрого переключения между проектами.
Быстрое открытие файла аля SublimeText
По Ctrl + N можно быстро открыть файл с нужным классом, а по Shift + Ctrl + N вообще любой файл по имени. А через Ctrl + Shift + Alt + N можно найти любой "символ", т.е. переменную, функцию и т.п.
Быстрый переход к объявлению
Все вкурсе, что по Ctrl + клик можно перейти к определению "символа". Но по нажатию Ctrl + Alt + Left можно вернуться назад. А по Ctrl + Shift + Backspace можно вернуться к последнему месту редактирования кода, если вы вдруг заблудились в длинном скролле.
Быстрое обертывание
Выделив фрагмент кода и нажав Ctrl + Alt + T можно быстро обернуть блок в if-else или какой-либо цикл. Так же при редактировании HTML срабатывает Ctrl + Alt + Enter. Это обертывание с помощью Emmet.
Synchronize folders
PhpStorm lets you sync the contents of two folders, or apply changes from one folder to another.
For each file, click the icon in the * column until you've set an action to be taken on that file.
: copy the selected item from the left to the right folder. If such file already exists in the right folder, it will be overwritten.
: copy the selected item from the right to the left folder. If such file already exists in the left folder, it will be overwritten.
: no action will be performed (the two files are identical).
: no action will be performed (the two files are different).
: remove the selected item.
Do one of the following:
To apply the selected action to the current item, click the Synchronize Selected button on the toolbar.
To apply the selected actions to all items, click the Synchronize All button on the toolbar.
Мульти буфер обмена
Как часто бывало, что скопированное в буфер терялось из-за еще одного копирования? PhpStorm из коробки запоминает все что было в буфере и можно использовать Ctrl + Shift + V для вставки прошлых значений.
Compare folders
Select the folders you want to compare in the Project tool window.
From the context menu, choose Compare Directories , or press Ctrl+D .
Use the following toolbar buttons to filter the list:
: click to display files that are present in the left folder, but are missing from the right one.
: click to display files that are present in the right folder, but are missing from the left one.
: click to display files that are present in both folders, but whose contents, timestamp or size are different.
: click to display files that are present in both folders and that are identical with regard to the option selected in the Compare by dropdown.
Context menu commands
This context menu is available in the middle of the editor:
Select this check command to show whitespaces as the dots in the Differences Viewer .
Show Line Numbers
Select this check command to show line numbers in the Differences Viewer.
Show Indent Guides
Select this check command to have PhpStorm display vertical lines in the Differences Viewer to indicate positions of indents.
Select this check command to have PhpStorm wrap the lines of code, when the dialog is resized.
Use this menu item to select the highlighting level in the Differences Viewer. To learn more about the level of highlighting, refer to Change the highlighting level for a file.
Select this check command to annotate the changes.
This command is available only for the files under version control.
This context menu is available in both editors:
Select these commands to accept or append the lines shown in the Differences Viewer.
Compare with Clipboard
Select this command to compare the file in the respective pane of the Differences Viewer with the contents of the Clipboard.
Select this check command to annotate the changes.
This command is available only for the files under version control.
This context menu is available in the right-hand strip of the Differences Viewer:
Go to high-priority problems only/Go to next problem
Click one of these radio-buttons to define the way of navigating between the encountered problems.
Customize highlighting level
Click to show the slider to change the highlighting level in the Differences Viewer.
Show code lens on scrollbar hover
Enables viewing code outside of the visible area of the Differences Viewer when hovering the mouse over the scrollbar.
Задачи
Если вы еще не пользуетесь системой контроля версий в PhpStorm, то самое время начать. Именно потому, что в этой IDE реализована потрясающая система разбиения текущих изменений на задачи (tasks).
Допустим, вы работаете над неким функционалом, уже изменен десяток файлов и идет второй день работы без коммитов. Прибегает манагер и просит "нувотпрямщаспоправьэтуфигню". И тут начинаются неудобства. Нужно запомнить какие изменения относятся к вашей основной задаче, а какие относятся к этой мелкой правке, чтобы правильно разбить изменения на два коммита.
PhpStorm решает эту проблему за вас. Все что вам нужно, создать отдельную задачу (Task) или Changelist (не понял в чем между ними принципиальная разница, если кто-то объяснит, опубликую), назначить его активным и сделать быструю правку. При этом вы увидите, что PhpStorm отнесет изменения в файлах к вашей активной задаче. А если вы случайно затроните файлы из другой параллельной задачи, то увидите предупреждение.
Автогенерация кода
Довольно банальная функция, но многие о ней и не подозревают. Поставьте курсор внутрь класса и нажмите Alt + Insert. Появится меню автогенерации кода. Можно создавать конструкторы, геттеры/сеттеры (сразу для нескольких выбранных вами свойств), PHPDoc блоки, а так же реализовывать методы интерфейсов или переопределять методы родительского класса.
Очень удобно работает реализация/переопределение методов. Автоматически именуются параметры и создается PHPDoc. Так же можно по-быстрому вызвать только переопределение методов (Ctrl + O) или только реализацию иинтерфейсов (Ctrl + I).
Понажимайте Alt + Enter в различных положениях курсора. Например, на неимпортированном классе, это позволит автоматически импортировать его. А вообще это мега сочетание, которое умеет очень многое.
Comparison table
The table lists the items that meet the comparison criterion specified in the Compare by list and the filtering criteria specified through the toolbar buttons.
The column lists names of files or data source objects that belong to the object specified in the path field.
The column lists file sizes.
The column lists file timestamps.
The column lists actions that will be applied to the pair of items in one row.
: copy the item on the left side to the right side. This action might overwrite the contents of the corresponding target item, if the target item already exists.
: copy the item on the right side to the left side. This action might overwrite the contents of the corresponding target item, if the target item already exists.
: items in both objects are treated identical with regard to the selected comparison options. No action is performed.
: the items differ according to the selected comparison options. No action is performed. You can explore the differences between objects in the Differences Pane and change the intended action by clicking its icon.
: the item exists only in one of the folders and will be removed.
Also, you can apply the action by clicking Synchronize Selected or Synchronize All toolbar buttons. The Synchronize Selected button applies operations only to the selected files. The Synchronize All button applies operations to all the files
To change the selected action, click the action icon in the * column.
Toolbar
Tooltip and shortcut
Navigate between next and previous differences.
When the last or first difference is hit, PhpStorm suggests to press F7 / Shift+F7 once more and compare other files.
This feature becomes available only when the Differences Viewer is invoked from the Version Control tool window Alt+9 .
Jump to Source F4
Open a file in the active tab of the editor. The caret is placed in the same position as in the Differences Viewer .
Refresh the contents of the differences viewer.
Show new files on left side
Display items that are present in the first of the compared directories or database objects and are missing in the second one in the left pane.
Show diff in external tool
Invoke an external differences viewer. For more information about the external differences viewer, see the External Diff Tools page.
This button is only available if the Use external diff tool option is selected in the External Diff Tools settings page.
Display items that are present in both folders or database objects but have different contents, timestamp, or size.
Show equal files
Display items that are present in both directories or objects and have the same contents, timestamp, and size, depending on the parameter set in Compare by list.
Show new files on right side
Show the items that are present in the second of the compared directories and are missing in the first one. The same rule applies to database objects.
Applies the selected parameter for comparison. You can select between the following parameters:
Text (charset and line separators are ignored)
Size and Timestamp
Synchronize Selected Enter
Apply the specified action to the selected pair of items.
In the * column of the table, you can see actions that are going to be performed.
Synchronize All Ctrl+Enter
Apply the specified action to all the pairs of items in the list.
In the * column of the table, you can see actions that are going to be performed.
Hide excluded files
Filter objects in comparing folders.
You can type a file or table name and filter all the objects according to this name. Use the asterisk wildcard (*) to replace any number of arbitrary characters.
Note that filter applies when you press Enter .
These fields show the paths to the folders that are compared. To change a directory, click the Browse button () and specify another directory.
These read-only fields show the names of the data sources or tables being compared.
Open a browser and show the corresponding help page.
Compare two SQL queries
You can compare contents in the clipboard with selected part of an SQL query.
Copy an SQL query to the clipboard.
Select and right-click the query in the editor with which you want to compare the query in the clipboard. Without selecting the query, you compare the clipboard contents with the whole file.
Context menu
The context menu appears when you right-click an entry in the list of items. The commands in this menu define which action must be taken for the selected entry when you click Synchronize Selected or Synchronize All. The selected action appears in the * column.
Set Copy to Right/Left
Copy a file missing in one of the directories.
Remove an action icon.
Set Mirror to Right
Mirror the contents of the left folder in the right folder when you click Synchronize All .
Set Mirror to Left
Mirror the contents of the right folder in the left folder when you click Synchronize All .
Set the default action for the entry.
Warn When Delete
Display a warning before deleting a file that is located only in one of the two directories during their merge.
File comparison statuses and intended operations are shown in the column marked with an asterisk (*). To assign or change an operation, use the context menu associated with the corresponding cell. Alternatively, click the cell or press Space one or more times.
The file exists only in the left-hand folder. The intended operation is to copy the file to the right-hand folder.
If a file exists in both folders and you apply this operation, the file in the right-hand folder is overwritten.
For the selected comparison criterion, the files are not identical. No operation is assumed.
Study the file differences in the lower part of the view. You can choose to overwrite one of the files by assigning and applying the corresponding operation. You can as well modify the file contents.
This may be done by typing or by using the following buttons and context menu commands:
or or Replace . Replace the fragment with the one from the other pane.
or or Insert . Insert the fragment into the other pane.
Remove . Remove the corresponding fragment.
To undo the changes, use Ctrl+Z .
For the selected comparison criterion, the files are identical. No operation is assumed.
The file exists only in the right-hand folder. The intended operation is to copy the file to the left-hand folder.
If a file exists in both folders and you apply this operation, the file in the left-hand folder is overwritten.
Delete the file. The operation is not available for files that exist in both folders.
PhpStorm lets you review the differences between any files, folders, text sources, or database objects, as well as between local files and their repository versions.
Сравнение двух файлов
PhpStorm имеет очень няшное окно diif-а, т.е. сравнения двух файлов. Если в дереве проекта выделить пару файлов и нажать Ctrl + D, то можно сравнить содержимое этих двух файлов.
Differences pane
The differences pane is displayed only for files and data source objects that have the same names and exist in both folders. If a file or a database object exists only in one folder, the pane displays the contents of the selected file.
To switch between the panes of the differences viewer, press Ctrl+Tab . The active pane has the cursor.
Compare different files in two folders
Sometimes a file may be present in one folder, and another file with a similar name in the other folder (for example, VCS_library_1.4 and VCS_library_1.5 ). These may be versions of the same file that you want to compare. Also, there may be a situation when you think a file was renamed, but is otherwise identical to a file in another folder. PhpStorm lets you compare two files, one of which is present in the right folder, and another one in the left even though such files are treated as different entities.
This action is only available for files in folders with the same relative path.
Select the files you want to compare in the left and the right pane.
Click the Compare New Files with Each Other icon on the toolbar. The differences between the selected files will be displayed in the bottom pane.
Рефакторинг
PhpStorm умеет кучу всего: выделять одинаковые участки кода в метод (Extract -> Method), выделять участки кода в переменную (Extract -> Variable), выделять поля и константы. Просто покапайтесь в разделе Refactoring. Или есть прекрасная статья на эту тему.
Diff & Merge viewer
Tooltip and Shortcut
Previous Difference / Next Difference Shift+F7 F7
Jump to the next or previous difference.
When the last or the first difference is reached, PhpStorm suggests clicking the arrow buttons or pressing F7 / Shift+F7 once more and comparing other files modified locally. This behavior depends on the Go to the next file after reaching last change option in the Differences Viewer settings.
This behavior is supported only when the Differences Viewer is invoked from the Commit tool window Alt+0 .
Compare Previous/Next File
Compare the local copy of the previous or next file with its update from the server.
These controls are only available if more than one file has been modified locally.
Go To Changed File Ctrl+N
Display all changed files in the current change set and navigate to them. This action is only available when you review changes to multiple files.
Open the selected file in the editor. The caret is placed in the same position as in the Differences Viewer .
Select a viewer mode: side-by-side or unified. The side-by-side mode has two panels, the unified mode has one panel.
You can edit code and perform the Apply , Append , Revert actions in both viewers.
You can change text only in the right-hand part of the side-by-side viewer, or in the lower line in the unified viewer.
You can edit only local versions of your files. You cannot edit files that have read-only status.
Define how the differences viewer should treat whitespaces.
Do not ignore : white spaces are important, and all the differences are highlighted. This option is selected by default.
Trim whitespaces : trim whitespaces if they appear in the end and at the beginning of a line ( ("\t", " ") ).
If two lines differ in trailing whitespaces only, these lines are considered equal.
If two lines are different, trailing whitespaces are not highlighted in the By word mode.
Ignore whitespaces : white spaces are not important, regardless of their location in the source code.
Ignore whitespaces and empty lines : ignores whitespaces and empty lines. The following entities are ignored:
all whitespaces (as in the 'Ignore whitespaces' option)
all added or removed lines consisting of whitespaces only
all changes consisting of splitting or joining lines without changes to non-whitespace parts.
For example, differences between a b c and a \n b c are not highlighted in this mode.
Ignore imports and formatting : changes within import statements and whitespaces are ignored (whitespaces within String literals are respected though).
Select the way differences granularity is highlighted.
Highlight words : modified words are highlighted
Highlight lines : modified lines are highlighted
Highlight split changes : if this option is selected, big changes are split into smaller changes.
For example, A \n B and A X \n B X are treated as two changes instead of one.
Highlight symbols : modified symbols are highlighted
Do not highlight : if this option is selected, the differences are not highlighted at all.
Use the Do not highlight option when you work with the files that were significantly modified. In such cases, highlighting might introduce additional difficulties during a review.
Collapse unchanged fragments
Collapse all the unchanged fragments in both files. The amount of non-collapsible unchanged lines is configurable in the Diff & Merge settings page. To open the Diff & Merge page, open settings by pressing Ctrl+Alt+S and navigate to Tools | Diff & Merge .
Click this button to scroll both differences panes simultaneously. If this button is released, each of the panes can be scrolled independently.
Open a list of available settings.
These commands are also available from the context menu of the differences viewer gutter.
Include into commit Alt+I
This checkbox only appears if you invoke the Differences Viewer from the Commit Changes dialog with multiple changed files (all of which are deselected), and you explore the differences between them and hit the last difference in a file.
Select this checkbox if you want to include the file you've reviewed into the commit.
Open a browser and show the corresponding help page.
Switch between the panes of the differences viewer. The active pane has the cursor.
Apply differences between panes (in case of the side-by-side viewer) or between lines (in case of the unified viewer).
The chevron buttons can change their behavior:
Click and to apply changes. This behavior is the default one.
Press Ctrl to change or to or and append changes.
Click this icon to invoke the list of options allowing you to compare different versions of a file to resolve a conflict.
Note that Base refers to the file version that the local and the repository versions originated from (initially displayed in the middle pane), while Middle refers to the resulting version.
Apply All Non-Conflicting Changes
Click this button to apply all non-conflicting changes. You can also make this behavior automatic, by selecting the checkbox Automatically apply non-conflicting changes in the Diff & Merge page of the Settings/Preferences dialog.
Apply Non-Conflicting Changes from the Left/Right Side
Click these buttons to merge non-conflicting changes from the left/right parts of the dialog.
Annotate with GitBlame
This option is only available from the context menu of the gutter.
Use this option to explore who introduced which changes to the repository version of the file, and when. The annotations view lets you see detailed information for each line of code, such as the version from which this line originated, the ID of the user who committed this line, and the commit date.
For more details on annotations, refer to VCS annotations.
Compare active editor with any file
If you often need to compare files that are outside your project with the active editor, or don't want to have the Project tool window open, you can use the Compare File with Editor option that lets you choose any file and compare it with the active editor.
To add this action to the editor tab's context menu:
Press Ctrl+Alt+S to open the IDE settings and select Appearance & Behavior | Menus and Toolbars .
In the right pane, expand the Editor Tab Popup Menu node, click Add After , and choose the Compare File with Editor action under Version Control Systems | Diff & Merge .
Compare files
PhpStorm displays the differences in the Differences Viewer for Files:
To apply changes, use the chevron buttons and .
To append changes, press Ctrl — the buttons will turn into .
Compare two files
In the Project tool window, select the files you want to compare and choose Compare Files , or press Ctrl+D .
Alternatively, select one file, choose Compare With from its context menu, and select a file that is outside your project.
Productivity tips
On the Keymap page of the IDE settings Ctrl+Alt+S , locate this action under Version Control Systems | Diff & Merge .
You can swap sides in the Diff Viewer by pressing the icon on the toolbar.
Open Diff in a separate window
By default, Differences Viewer opens in an editor tab. You can configure the settings to open the viewer in a separate window instead. On the Advanced Settings page of the IDE settings Ctrl+Alt+S , disable the Open Diff as Editor Tab option.
Sometimes you have several different versions of files or folders related to your project locally, or you’ve just downloaded it from a remote source. In this case it’s crucial to work with the most up-to-date copy. If you need to merge changes and synchronise folders, then it can become even more complicated, as well as difficult to perform manually without any support.
The good news is that you can quickly and conveniently compare and/or synchronize files/folders with guidance and support from your IDE, without any external tools. PhpStorm and other IntelliJ Platform IDEs help you explore differences in many situations: differences between files, directories, revisions of the same file under version control or in the local history, database objects, or local and remote files.
In this post we focus on local files and folders comparison.
Comparing Files
You can compare a) any two files in your project, b) a selected file with the one opened in the editor, or c) a file in the editor with the clipboard contents. All comparisons are performed in the Differences Viewer.
To compare two files, press and hold Ctrl and click two files in the Project tool window. From the context menu of the selection, choose Compare Two Files (or Ctrl+D). If you select a single file in the Project tool window, the context menu command is Compare File with Editor. The Differences Viewer shows the contents of the selected file on the left pane, and the contents of the active editor tab on the right pane.
To compare a file with the clipboard contents, open the file in the editor, right-click the editor pane and choose Compare with Clipboard from the context menu:
Difference Viewer shows all the differences and highlights the source code. You can move between changes and perform actions by clicking the icons (e.g. insert, etc.).
Comparing Folders
Folders are compared by comparing all the files in the two folders based on their file sizes, contents, or timestamps. The Differences Viewer shows the contents of the selected directories in the left and right panes. The contents of the selected file are shown in the lower pane, with the differences highlighted. In addition to exploring differences, you can also use this tool to synchronize the folders’ contents.
To compare two folders, press and hold Ctrl and click two directories in the Project tool window, then choose Compare Directories from the context menu of the selection (or press Ctrl+D). Alternatively, you can select a folder in the Project tool window, choose Compare with from the context menu of the selection, and then select the second directory in the dialog:
In the Difference Viewer you can check all the differences and perform any actions you need. Files can be moved from one folder to another, and folders can be fully synchronized.
You can also open the Difference Viewer without running PhpStorm. Use this command: diff where path_1 and path_2 are paths to the folders you need compared.
Use these IDE features to compare files and folders so you can always work with the latest version of your source code.
This dialog is displayed when you compare two files or two versions of a file (local changes or changes between local files and their revisions in a remote repository). You can compare files of any types, including binaries and .jar files. To open the dialog, select two files to compare or a file to compare its versions and press Ctrl+D .
The differences viewer provides a powerful editor that enables code completion, live templates, and other features.
Compare active editor with Clipboard
Right-click anywhere in the editor and choose Compare with Clipboard from the context menu.
Productivity tips
Compare active editor with a project file
Right-click the file you want to compare with the currently opened file in the Project tool window.
Choose Compare File with Editor from the context menu.
Keyboard shortcuts
Use this keyboard shortcut to show the popup menu of the most commonly used diff commands.
Use this keyboard shortcut to switch between the left and the right panes.
Use this keyboard shortcut to undo/redo a merge operation. Conflicts will be kept in sync with the text.
Метки в проекте
Нажимая Ctrl + Shift + 0..9 можно оставлять в проекте метки. Чтобы быстро перейти к какой-либо метке нужно нажать Ctrl + 0..9 (номер метки).
Compare a local file with its repository version
Select a modified file anywhere in the Version Control tool window.
Click on the toolbar or press Ctrl+D .
Форматирование кода
Совсем очевидная фича, но некоторые о ней не знают. По нажатию Ctrl + Alt + L осуществляется автоформатирование текущего файла, либо выбранного фрагмета кода. Если в дереве проекта выбрать файл и нажать то же сочетание, то он полностью будет отформатирован. Можно так же выбрать папку и будет отформатирована все файлы в этой папке.
Productivity tips
To assign shortcuts to the apply and append actions, open the Keymap page of the IDE settings Ctrl+Alt+S and locate these actions under Version Control Systems | Diff & Merge .
When you are comparing two files, or a file with the Cliboard contents, you can swap sides by clicking on the toolbar.
Автогенерация кода
Довольно банальная функция, но многие о ней и не подозревают. Поставьте курсор внутрь класса и нажмите Alt + Insert. Появится меню автогенерации кода. Можно создавать конструкторы, геттеры/сеттеры (сразу для нескольких выбранных вами свойств), PHPDoc блоки, а так же реализовывать методы интерфейсов или переопределять методы родительского класса.
Очень удобно работает реализация/переопределение методов. Автоматически именуются параметры и создается PHPDoc. Так же можно по-быстрому вызвать только переопределение методов (Ctrl + O) или только реализацию иинтерфейсов (Ctrl + I).
Понажимайте Alt + Enter в различных положениях курсора. Например, на неимпортированном классе, это позволит автоматически импортировать его. А вообще это мега сочетание, которое умеет очень многое.
Список использований
Не уверены, используется ли где-то ваш метод? Поставьте на него курсор и нажмите Ctrl + F7. Появится список использований метода, переменной или другого "символа". Можно использовать Ctrl + Alt + F7, тогда список появится в виде контекстного меню, что иногда чуть удобнее.
Compare folders
PhpStorm lets you compare files in two folders against their file size, content, or timestamp. The differences are displayed in the Differences Viewer for Folders:
The top pane lists all files in the selected folders, while the bottom pane shows the differences between two versions of the selected file (see Compare files).
You can also open the difference viewer without running PhpStorm. Run the following command: diff where path_1 and path_2 are paths to the folders you want to compare.
Diff viewer
Tooltip and Shortcut
Previous Difference / Next Difference Shift+F7 F7
Jump to the next or previous difference.
When the last or the first difference is reached, PhpStorm suggests clicking the arrow buttons or pressing F7 / Shift+F7 once more and comparing other files modified locally. This behavior depends on the Go to the next file after reaching last change option in the Differences Viewer settings.
This behavior is supported only when the Differences Viewer is invoked from the Commit tool window Alt+0 .
Compare Previous/Next File
Compare the local copy of the previous or next file with its update from the server.
These controls are only available if more than one file has been modified locally.
Go To Changed File Ctrl+N
Display all changed files in the current change set and navigate to them. This action is only available when you review changes to multiple files.
Open the selected file in the editor. The caret is placed in the same position as in the Differences Viewer .
Select a viewer mode: side-by-side or unified. The side-by-side mode has two panels, the unified mode has one panel.
You can edit code and perform the Apply , Append , Revert actions in both viewers.
You can change text only in the right-hand part of the side-by-side viewer, or in the lower line in the unified viewer.
You can edit only local versions of your files. You cannot edit files that have read-only status.
Define how the differences viewer should treat whitespaces.
Do not ignore : white spaces are important, and all the differences are highlighted. This option is selected by default.
Trim whitespaces : trim whitespaces if they appear in the end and at the beginning of a line ( ("\t", " ") ).
If two lines differ in trailing whitespaces only, these lines are considered equal.
If two lines are different, trailing whitespaces are not highlighted in the By word mode.
Ignore whitespaces : white spaces are not important, regardless of their location in the source code.
Ignore whitespaces and empty lines : ignores whitespaces and empty lines. The following entities are ignored:
all whitespaces (as in the 'Ignore whitespaces' option)
all added or removed lines consisting of whitespaces only
all changes consisting of splitting or joining lines without changes to non-whitespace parts.
For example, differences between a b c and a \n b c are not highlighted in this mode.
Ignore imports and formatting : changes within import statements and whitespaces are ignored (whitespaces within String literals are respected though).
Select the way differences granularity is highlighted.
Highlight words : modified words are highlighted
Highlight lines : modified lines are highlighted
Highlight split changes : if this option is selected, big changes are split into smaller changes.
For example, A \n B and A X \n B X are treated as two changes instead of one.
Highlight symbols : modified symbols are highlighted
Do not highlight : if this option is selected, the differences are not highlighted at all.
Use the Do not highlight option when you work with the files that were significantly modified. In such cases, highlighting might introduce additional difficulties during a review.
Collapse unchanged fragments
Collapse all the unchanged fragments in both files. The amount of non-collapsible unchanged lines is configurable in the Diff & Merge settings page. To open the Diff & Merge page, open settings by pressing Ctrl+Alt+S and navigate to Tools | Diff & Merge .
Click this button to scroll both differences panes simultaneously. If this button is released, each of the panes can be scrolled independently.
Open a list of available settings.
These commands are also available from the context menu of the differences viewer gutter.
Show diff in external tool
Invoke an external differences viewer specified on the External Diff Tools settings page.
This button is available only on the toolbar when the Use external diff tool option is enabled on the External Diff Tools settings page.
Open a browser and show the corresponding help page.
Apply differences between panes (in case of the side-by-side viewer) or between lines (in case of the unified viewer).
The chevron buttons can change their behavior:
Click and to apply changes. This behavior is the default one.
Press Ctrl to change or to or and append changes.
Автогенерация спрайтов
Автоматическая генерация CSS спрайтов не доступна из коробки, однако настраивается за 15 минут без особых проблем. В итоге вы получите полностью автоматическое создание PNG спрайтов с готовыми CSS/LESS стилями.
This window is displayed when you explore the differences between:
By using this dialog, you can explore differences and synchronize files between different folders.
You can also open the difference viewer without running PhpStorm. Run the following command: diff where path_1 and path_2 are paths to the folders you want to compare.
Читайте также: