Sublimerge 3 documentation
|
TutorialIf you have at least one file open in Sublime Text, press ctrl+alt+d to view list of available commands for current file. The same commands (except the ones defined in Macros) appears in Command Palette.
Number of displayed commands may change depending on many factors, i.e. clipboard contents, VCS presence, etc. Some other commands are not displayed in this list because of their low priority, however they may be accessed from Command Palette and context menus.
Comparing local filesThis chapter describes all commands that may be available after pressing ctrl+alt+d. Compare to View...Allows to compare current view with another. After selecting this command you will get a list of all other comparable views from current window.
By default the list contains only views of the same syntax and is sorted intelligently in the order of name similarity to current view. Both behaviors may be changed by intelligent_files_sort and same_syntax_only settings. Read Configuration/Default settings for more details.
If list is empty, this command is unavailable. If list contains only one item, command is renamed to `Compare to <file name>` and runs diff immediately.
Compare to Snapshot...This command appears if there is at least one snapshot of current view that differs from current view's state. After selecting this command you will get the list of available snapshots to compare with current view.
Snapshot is opened on the left-hand side and is read-only. You can only merge changes from left to right.
Compare to ClipboardThis command appears when clipboard contents can be used to compare with current view. After selecting this command current view will be compared to clipboard contents.
The pane containing clipboard contents will be opened in read&write mode. When you save it, the contents of the view will be copied back to your clipboard.
Compare Selected LinesUse this command to quickly spot differences between two selected lines (or regions) of text in current view. This command appears when you perform two non-empty selections in current view.
Your selections does not have to be perfect. Sublimerge will automatically expand each selection to full lines. You can modify the text in the diff view. When you save it, the contents will be copied back to the source lines or regions.
Compare Selected Lines to ClipboardUse this command to compare selected lines (or regions) of text from current view with clipboard contents.
Both panes will be opened in read&write mode. When you save them, the changes will be copied back to their source (clipboard or text).
Compare Selected Lines in Views...With this command you can quickly spot differences between single non-empty selections from multiple views. It appears when current view, and at least one another comparable view, contains single non-empty selection. When you run this command, you will get a list of views which can be compared to current view.
Only views containing exactly one selection are taken into account. This command is also limited to views with the same syntax as current view. You can change this behavior by editing same_syntax_only setting. Read Configuration/Default settings for more details.
Show Unsaved ChangesThis command is available when current view is created from a file (file path is known) and is in dirty state. Running this command will show diff between current state and last saved state. With this command you can selectively revert unsaved changes.
Last saved state is opened on the left-hand side and is read-only. You can only merge changes from left to right.
Comparing versioned filesIf you use Git, Subversion or Mercurial, Sublimerge will greatly improve your workflow. It will automatically discover versioned files and the VCS system to use. Then it will let you compare (and merge) your working copy with revisions, branches, tags or even see what changes are not commited/pushed. Thanks to Macros engine, the number of custom workflows is limited only by your imagination. To complete your workflow, you can setup Sublimerge as a diff viewer and merge tool not only for Git, Subversion and Mercurial, but probably for anything else. Please take a look at VCS integration for more information about VCS support.
These features may require additional configuration if VCS executables are not in your system's PATH. For more information, please take a look at Configuration/Default settings/VCS support.
Compare to Revision...Use this command to compare file in current view to its any revision. Running this command displays VCS history of the file in view so that you can easily select interesting revision. It may take a while for history to be retrieved.
Revision file is opened on the left-hand side and is read-only. You can only merge changes from left to right.
Compare to Other/Named Branch...Git and Mercurial only. Compares file in current view with the same file in another branch. Running this command displays list of branches allowing you to select the interesting one. For Git it is called Compare to Other Branch..., for Mercurial Compare to Named Branch....
Please be aware that it may fail when file exists in current branch, but not in selected one. Sublimerge does not perform such check before displaying list of branches because of performance reasons.
File from selected branch is opened on the left-hand side and is read-only. You can only merge changes from left to right.
Compare Revision to Revision...Use this command to compare two different revisions of file from current view. Running this command displays two commits history lists allowing you to select interesting revisions. It may take a while for history to be retrieved.
First selected revision is opened on the left-hand side, second on the right-hand side. Both files are opened in read-only mode allowing you only to see the differences. This is because there is no sense to merge changes between already commited revisions.
Show Changes Between Current and Remote...Git only. Compares current HEAD to selected remote. Running this command displays list of available remotes allowing you to select the interesting one. After selecting remote it will display list of files that are different. Selecting one runs diff.
File from selected remote is opened on the left-hand side, from HEAD on the right-hand side. Both files are opened in read-only mode. Because of performance reasons Sublimerge does not check if listed file exists in both remote and HEAD so it may fail after selecting non-existing file.
Show Changes Introduced in Revision...This command works the same as Compare Revision to Revision... except that it compares selected revision with previous one (if exists).
Previous revision is opened on the left-hand side, selected one on the right-hand side. Both files are opened in read-only mode.
Show Uncommited Changes...Displays list of files that are modified and not yet commited. Allows you to select interesting one to show differences and selectively revert changes.
File from repository is opened on the left-hand side in read-only mode so that you can merge changes only from left to right.
Show Unpushed Changes...Git only. Displays list of files that were commited to remote-tracking branch, but not yet pushed to a remote.
Both files are opened in read-only mode allowing you only to see the differences.
List and Resolve Conflicts...Git only. When you merge or rebase it may happen you get merge conflicts. This command will list all the conflicted files and let you open three-way diff to resolve conflicts. Using this command does not require setting up Sublimerge as a merge tool for Git. Resolve Conflicts in Current FileGit only. If you open a file containing merge conflicts, this command will open three-way diff to resolve them. Using this command does not require setting up Sublimerge as a merge tool for Git. Compare to Custom Git/Hg/SVN Command Output...Runs custom VCS command in the repository root and allows to compare current view to returned output. SnapshotsSnapshots can be used to temporarily store important changes. This is handy when you are working on some feature and, for instance, want to compare performance of a number of possible solutions. Instead saving the changes to another file or having them stored in clipboard, you can create a snapshot which will be stored in memory until the view is closed or you decide to delete it. All snapshot-related commands are accessible from view's context menu, tab's context menu and file's context menu. They are not configured to use keyboard shortcuts, but you can do it by yourself.
Creating new snapshotFrom context menu select Create Snapshot... command. In the input box appearing on the bottom type a descriptive snapshot name and press enter.
Creating a snapshot is not possible when there already exists the same snapshot. In this case the command will not be visible.
Reverting to snapshotFrom context menu select Revert to Snapshot... command. From the appearing list select the snapshot and hit enter.
This command is not available when there is no snapshot that is different from current view.
Replacing snapshotFrom context menu select Replace Snapshot... command. From the appearing list select the snapshot you want to replace and hit enter.
This command is not available when there are no snapshots that are different from current view.
Removing snapshotFrom context menu select Remove Snapshot... command. From the appearing list select the snapshot you want to remove and hit enter.
This option is not available if there are no snapshots created.
Comparing directoriesWith Sublimerge you can browse, compare and apply changes between directories without leaving Sublime Text. In Sublime TextTo do so, simply select (exactly) two directories in Side Bar. Then, from context menu, choose Sublimerge > Compare Selected Directories. Depending on directories size it may take a while for diff window to show up. For navigation please take a look at Configuration/Key Bindings/In directories diff view.
Pay attention to your selection in Side Bar. For directory comparison you must select only and exactly two directories. Otherwise the command will not be available. Also remember that you can't compare parent directory with its descendant.
Important notes
|