Diff files" feature, or using Fi" /> Diff files" feature, or using Fi" /> Diff files" feature, or using Fi"/>

Comparing the contents of two files in Sublime Text, with a side by side view

10.7k Views Asked by At

I have already read Comparing the contents of two files in Sublime Text but the answers (either the native "Folders > Diff files" feature, or using FileDiffs) show the differences between 2 files like with the diff tool, which I don't want:

 --- file1.py
 +++ file2.py
 @@ -1,21 +1,19 @@
 -import os
 +import os, sys
 import numpy as np
 -print('hello')
 +print('hello world')
 -import sys

Instead, I would like a side-by-side comparison like this with PSPad native diff tool:

enter image description here

How to achieve this side-by-side comparison between two opened files in Sublime Text (2 or 3)?

Is it possible natively with Sublime Text?

2

There are 2 best solutions below

0
ToTamire On BEST ANSWER

Installation for Windows and Linux:

  • Press CTRL + SHIFT + P
  • Type Package Control: Install Package
  • Press ENTER
  • Type Compare Side
  • Select package named Compare Side-By-Side

How to use?

  • Select one tab which you want to compare
  • Right Mouse Button on second tab which you want to compare
  • Select Compare with active tab

How it looks?

Compare Side-By-Side example

4
MattDMo On

Yes, you can do this without plugins. First, select View → Layout → Columns: 2

View -> Layout -> Columns: 2 screenshot

making your window look like this

2 columns screenshot

Then, drag your desired tab over to the other pane

2 panes, 2 files screenshot

and you should be all set.