Sublime Forum

File Compare (Diff utility)?

#1

Does Sublime Text 2 have FIle Compare (equivalent of diff bundle in text mate)?
How do I install or use Diff (file compare) in sublime text 2?

I am switching from text mate on Mac to Sublime Text 2. I have tried Sublime Text 2 for couple of days now and I really like it so far.
Great Job Sublime Text team.

0 Likes

#2

I recommend SublimeFileDiffs. The README has installation and usage info.

0 Likes

#3

I installed the FileDiff package.
Now, how can I call the different commands ?
I notice that 1 is bound to ctrl-shift-D, but that is already linked to an other command which duplicates the line). I dont necesseraly want it to be bound to some key-code, how can I select it from the menu or something like that?

0 Likes

#4

Sorry for the off-topic reply but I am also interested in this thread. Is there a way to get email notifications when someone replies?

Thanks!

0 Likes

#5

No :frowning:

0 Likes

#6

Hi there! I wrote FileDiffs, so I feel compelled to answer these questions, but my answer is generic.

There are many ways a plugin can make expose its commands. The most basic is to simply provide the classes and let the user figure it out. Not very helpful, but if the developer is busy, this is all youā€™re gonna get.

Next, and you can provide a .sublime-commands file that will add the commands to the ā€œcommand paletteā€ (ctrl+shift+P I think). This is good because it provides a place for users to look up the important commands and, hopefully, the argument syntax if the command has some optional arguments. I usually provide these files, and indeed FileDiffs does have one.

Next, you can (but I donā€™t) provide .sublime-keymap files. I frown on providing these, though, because I hold key bindings as ā€œoff limitsā€. I like mine, I donā€™t expect you to. However! I always include a file called Example.sublime-keymap, which can be copied into your keymap file.

0 Likes

#7

@colinta, for those of us brand new to sublime, can you possibly provide (in addition to the generic answer) a specific answer? I need a bit more ā€œhand-holdingā€ā€“specific steps to make diff work.

0 Likes

#8

Hereā€™s the steps I took:

c:\> cd %APPDATA%\Sublime Text 2\Packages

c:\> git clone http://github.com/colinta/SublimeFileDiffs.git
Cloning into SublimeFileDiffs...
remote: Counting objects: 123, done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 123 (delta 73), reused 89 (delta 39)
Receiving objects: 100% (123/123), 18.20 KiB, done.
Resolving deltas: 100% (73/73), done.

Thatā€™s it. Then, when I want to diff two files, I:

1> Click on the first file, to make it the active tab.
2> Open the command list: [CTRL]+[SHIFT]+[P]
3> Type in ā€œdiffā€ to filter the list
4> Select FileDiffs: Menu
5> Choose a ā€œDiff File Withā€¦ā€
6> Watch the fireworks!

0 Likes

#9

Is the FileDiffs plugin still the best option for file compare using Sublime Text 2?

0 Likes

#10

I like Sublimerge

github.com/borysf/Sublimerge

0 Likes

#11

Ah ā€“ yes! I just installed the Sublimerge package and the side by side comparison is EXACTLY what I was looking for. Thank you very much ā€“ greatly appreciated!

0 Likes

#12

+1 Sublimerge Pro

0 Likes

#13

I always have found diffing in a number of plugins awkward. My need isnā€™t to merge them directly in Sublime; I usually use an external tool to do such things (the right tool for the job and all that). But I do often want to see a quick diff. I was looking for something less awkward and a bit more intuitive for myself, so I wrote a personal plugin that I have not released, but if anyone likes it, they can use it:

Its just two files that you can drop in your user folder (only for ST3):

github.com/facelessuser/sublime ā€¦ sy_diff.py
github.com/facelessuser/sublime ā€¦ e-settings

It basically creates a dynamic context menu in the fileā€™s view window to allow a more intuitive selection of files to diff, and allows you to easily see what you have stored in the left side. It does the basic single view diff, but I find it useful. It also tracks when a view that is on the left side has been closed, so the context menu will update accordingly if the view is no longer available.


Since I havenā€™t released this, use at your own risk, and I am not really taking feature requests or offering support; there would have to be a pretty big desire for this to be on Package Control for me to support another repo (which I doubt there will be; there are plenty of diff packages available). I just find the dynamic context menu more intuitive for my needs. I am sure one of the many diff packages out there could pick up a feature like thisā€¦I just havenā€™t seen it yet. Maybe by posting this here, someone will pick up a feature like this, and then I can just use their diff plugin :smile:.

0 Likes

#14

[quote=ā€œnolloā€]I like Sublimerge

github.com/borysf/Sublimerge[/quote]

I just checked out Sublimerge, looks great. Love how you donā€™t need to use a third party program.
I wish it integrated itself in the same view though rather than launching another instance of sublime.

Once PayPal is working again (currently acting up) I am going to grab a copy, it looks well worth the $10.

0 Likes