To compare files in Sublime Text 4 (ST4), we can use the Sublime packages:
Install new package
To install a new package in Sublime Text 4 follow these steps:
- Open Sublime Text 4
- go to "Tools"
- "Command Palette" - CTRL + Shift + P
- type "Package Control: Install Package" - press Enter
- Search for package and click on it
- i.e. Compare Side-By-Side
- i.e. DiffTabs
- wait for message that the package is installed
Compare Side-By-Side
To compare files with ST4 package - "Compare Side-By-Side" follow:
- open the files in ST4
- tab1 - active
- tab2
- right click on the tab2 which is not active
- choose "Compare with active tab"
- New window with differences will open
The result is shown on the link below:
Fix Compare Side-By-Side for ST4
Package Compare Side-By-Side is not compatible with ST4. To fix this package you can follow:
- Locate package folder
- i.e. Linux
/home/user/.config/sublime-text-3/Installed Packages
- i.e. Linux
- Open Compare "Side-By-Side.sublime-package" with zip tool
- Extract
sbs_compare.py
- Open
sbs_compare.py
in Sublime Text. - Add the following lines to file:
# move view 1 to group 1
new_window.set_view_index( new_window.active_view(), 0, 0 )
on lines line 572 and line 573.
- Replace the file in the archive
- Restart Sublime
Source: How to compare files in ST4?
DiffTabs
As an alternative you can use the Sublime package DiffTabs. It is compatible with ST4 and compares two tabs in a similar way to Compare Side-By-Side.
To compare two files in Sublime with DiffTabs:
- open the files in ST4
- tab1 - active
- tab2
- right click on the tab2 which is not active
- choose "Diff with current tab"