Sublime Forum

How to diff two files?

#1

I’am a newb with ST2.
I don’t understand how to diff two files with ST2 on Mac OSX.
Any suggestions appreciated.

Best regards,
Anton.

0 Likes

#2

Highlight both file names in the sidebar and right click. Diff is in the menu that appears.

0 Likes

#3

Only one item “Close” appears in that menu.
This method works in TextWrangler editor.

0 Likes

#4

The above method works, but the files have to reside in the same directory as each other or it does not show the Diff on the right-click menu and it’s not a side by side comparision.

0 Likes

#5

It only works from the open folders in the side-bar (not from the “Open files” section)…

It seems to work for me between two different directories.

The diff either puts a message in the status bar that the files are identical or it generates a unified diff result.

0 Likes

#6

[quote=“jbjornson”]It only works from the open folders in the side-bar (not from the “Open files” section)…

It seems to work for me between two different directories.

The diff either puts a message in the status bar that the files are identical or it generates a unified diff result.[/quote]

Thanks, jbjornson, diff really works from “open folders” in the side-bar.
And appears another question - is there a useful package with two panels diff like a WinMerge for Mac OS X?

0 Likes

#7

Apparently there is a free diff tool included with Apple’s development tools, XCode:
stackoverflow.com/questions/1870 … r-mac-os-x

Download it from here:
developer.apple.com/technologies/tools/

There are some links to reduce how much of XCode you have to install here:
drupal.org/node/85184

There is also an open source tool called DiffMerge:
sourcegear.com/diffmerge/

I have no clue how useful these tools are…unfortunately I don’t get to do too much development on my Mac at home.

0 Likes

#8

Thanks, man.

0 Likes

#9

Apple’s tool is fine, but the best diff tool I’ve found for the Mac is (oddly enough) bbdiff which is part of the BBEdit command line tools. Of course, if you don’t already own BBEdit it can be a stretch to pay $60 for it just for the diff tool when Apple’s is free (Apple’s is actually just a GUI for the CLI diff command which you can also use but is nowhere near as nice as having a GUI).

Does anyone know if there will be a diff tool with ST2?

0 Likes