Sublime Forum

How to Diff in Sublime 3?

#1

Hello. I’m a very light ST user. The main use I’ve acquired it for in the past is to compare changes between two similar code files. I have accomplished this easy before by selecting both files in the left column and simply selecting “diff”. I’ve discovered if I do this now however I only get “close, new file, or open file”. Does this feature not exist any more?? Thank you.

0 Likes

#2

Strangely, the tool to diff two files is a function of the** open folder** side bar, and not the** open files** sidebar.

  1. Select File|Open Folder from the menu.
  2. Select the folder that the two files you want to diff are in and click ‘Open’.
  3. If it is not already visible, click View|Side Bar|Show Side Bar.
  4. Select the two files to diff in the side bar by holding the ctrl key (linux) or command key (Mac) and selecting the files separately. They should both be highlighted in the side bar, although only one may be open in the window.
  5. Right click on the highlighted files and you should see the option to diff the files: ‘Diff Files…’

There are also several diff packages that you can install that have enhanced diff abilities.

I hope this helps.

4 Likes

#3

Thank you Sean for the response. So I feel like I’m going down the wormhole here, but, I don’t have “open folder” check out the attachment

0 Likes

#4

So I figured it out. Project > Add Folder to Project . This is less intuitive unfortunately compared to how it used to be in prior versions. If you have documents of the same name(s) for example. I’ll work with it though, should be able to utilize it. Thanks.

0 Likes

#5

Save yourself some time (too late for money I guess) and use this: http://www.truehumandesign.se/s_diffinity.php

0 Likes

#6

@JKWBT Which version of sublime text are you using. I tried, and it’s working. I’m on st3.

@psiclone It’s very easy to compare to file and make a diff using Python. So, it’s very simple to create a plugin that’d to the job. And with the diff syntax of sublime text, it’s even better. So, no need for an other app.

Just a small tip: you can drag the folder in Sublime Text and it’ll do the same.

Do this mean you know only the very very basics of Sublime Text? Then, have a look a courses that suits you, you won’d regret it.

Here’s a few examples:

1 Like

#7

FileDiffs plugin :slight_smile:

1 Like

#8

JKWBT,

I’m using Sublime Text 3, build 3126 on Linux. I have both an ‘Open File’ and ‘Open Folder’ choice in my drop down menu. I’m guessing you are using a Mac, judging by the propeller short cut hint in your screen shot.

Maybe a mac user can help you out, sorry.

BTW - I still think ‘Open Apple’ and ‘Closed Apple’ when I see the propeller keys on a Mac. If you don’t know what I am referring to, do a google image search for ‘open apple closed apple keyboard’ and you’ll see some vintage Mac and Apple II keyboards with the key that became the propeller. I switched to Linux before Apple killed the Apple II line, so I’m a little rusty with Macs.

0 Likes

#9

There is an answer at stack overflow that says the files should both be open in the same project:

And there is a plugin called ‘compare side by side’ that will diff two files easily in subl:
https://packagecontrol.io/packages/Compare%20Side-By-Side

If you don’t already have it installed, install the plugin called ‘Package Control’:
https://packagecontrol.io/

It makes installing and maintaining packages in subl a breeze.

Good luck,

Sean

0 Likes

#10

That plugin seems to have an issue that bugs me when comparing files and the development seems to be inactive

0 Likes

#11

Try Sublimerge 3. IMO it is the most complete diff tool for Sublime Text.

2 Likes

#12
0 Likes