CLI tool
colinta/SublimeFileDiffs avatar
colinta/SublimeFileDiffs

FileDiffs: diffing a Sublime Text buffer against the clipboard or another file

Show diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes.

522 stars84 forksPythonNOASSERTION

At a glance

What is it?
FileDiffs is a Sublime Text package that shows the difference between the current file or the current selection and the clipboard, another file, the saved version of the file or the previously active file, with optional support for launching an external diff tool. It suits a Sublime Text user who keeps fragments in the clipboard and wants to see what changed, and it does not do merges.
Who is it for?
FileDiffs fits a Sublime Text user who works with pasted fragments and wants to see exactly what differs between the clipboard, the saved file and the buffer on screen, since the commands cover all of those comparisons. It is the wrong choice if you want a merge tool, since the package only shows diffs, and it is the wrong choice if you are on a Sublime Text build older than 3000, because the manifest requires that version.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 177 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What it diffs against

FileDiffs is a Sublime Text package described as showing diffs between the current file, or selections in the current file, and the clipboard, another file, or unsaved changes. It can be configured to show the diffs in an external diff tool.

The command list is the clearest description of what it does, and there are seven commands in all.

`file_diff_menu` shows a menu to select one of the file_diff commands, and it is bound to ctrl+shift+d in the example keymap. The rest of the commands do not need to be bound and are reachable from the menu.

`file_diff_clipboard` shows the diff of the current file or selections and the clipboard, with the clipboard considered the new file unless reverse is set to true. `file_diff_selections` shows the diff of the first and second selected regions, and the readme notes the menu command checks for exactly two regions selected and otherwise does not display this command. `file_diff_saved` shows the diff against the saved file. `file_diff_file` diffs against a file that is in the current project. `file_diff_tab` diffs against an open file, meaning a file that has a tab.

And `file_diff_previous` diffs against the previous activated file, with a detail that matters: if a file is not saved yet, the dirty buffer is used instead of reading from disk.

That last point is the one that makes the command useful in practice. Comparing against the previous file on disk would be misleading when the previous buffer has unsaved edits, so the package reads the in-memory version instead.

The scope is comparison and display. Nothing in the command list merges, applies a patch or writes a result, so this is a tool for looking at differences rather than for resolving them.

Installing it and adding the key bindings

Installation is through Package Control, where you install FileDiffs, or by cloning the repository into your packages folder. The readme recommends adding key bindings for the commands, and the example keymap is included in the repository.

The bindings look like this:

json
{ "keys": ["ctrl+shift+d"], "command": "file_diff_menu" },
{ "keys": ["ctrl+shift+e"], "command": "file_diff_menu", "args": {"cmd": ["opendiff", "$file1", "$file2"] } },

The first opens the diff menu. The second does the same but passes a cmd argument, here opendiff with $file1 and $file2, which is how you route the comparison into an external tool instead of the built-in view.

The package manifest requires Sublime Text 3000 or newer, which is build 3 of Sublime Text, and it declares tags as true so the package is versioned with its tags.

The menus are defined in Sublime's own menu format rather than in Python, with a Main.sublime-menu, a Context.sublime-menu and a Side Bar.sublime-menu, plus a Tab Context.sublime-menu for tab-specific entries. The Default.sublime-commands file lists the commands that can be bound, and FileDiffs.sublime-settings holds the plugin settings. The implementation itself is a single file, file_diffs.py.

That is a very small footprint for a Sublime Text package, and it explains how the plugin behaves. Sublime Text plugins are Python, and a plugin that opens a diff view and writes temporary files does not need much code.

The external diff tool and its configuration

The optional external diff tool is the feature that takes the plugin beyond Sublime Text's built-in diff view, and configuring it takes two steps.

First, open Preferences, then Package Settings, then FileDiffs, then Settings - Default, and uncomment one of the examples or write your own command to open the external diff tool. The readme flags that this command may need to be a full path, for example /usr/local/bin/ksdiff, if the command is not in your PATH, and that you might need to make a symlink in /usr/local/bin pointing to the command line tool of your diff tool.

Second, there is the settings model, and it is the more interesting part. The readme says it supports a generic setting `FileDiffs.sublime-settings` which could be overloaded for each parameter in a platform-specific configuration `FileDiffs ($platform).sublime-settings` in the Settings - User, and environment variable expansions for the cmd parameter in the settings.

The platform-specific override is the pattern Sublime Text uses for settings that differ per operating system, and the readme points out that the generic file is the base while the platform file is where a machine-specific value goes. Since the command is a path to an external binary, and the binaries differ per platform, the two-level arrangement lets the same package work on macOS, Linux and Windows without one file trying to describe all three.

The environment variable expansion for the cmd parameter matters for the same reason. A diff tool path can come from the environment, which means a team can standardise the tool and the path without touching the settings file.

Support for the external tool was contributed by Sebastian Pape, according to the credits in the readme.

Temporary files, the Data folder, and the privacy decision behind it

There is one implementation detail in the readme that tells you more about how the author thinks than any feature description.

If FileDiffs has to use temporary files, they are created in your Data/Packages folder rather than the system temp folder, due to privacy concerns for portable Sublime Text installations. Temporary files are automatically removed after 15 seconds.

The reason is the portable installation. A portable Sublime Text installation keeps all its state, including its packages, in a directory the user carries around, and a plugin that writes scratch files to the system temp directory leaves copies of your buffer contents somewhere outside the installation that the user controls. Putting them in Data/Packages keeps them inside the thing the user is already managing, and the 15 second cleanup keeps them from lingering.

That matters more here than it would for most plugins, because the content being diffed is whatever is in your editor. Diffing against the clipboard in particular means the plugin may need to write the clipboard contents to disk, and the clipboard is a place people put passwords and tokens.

The credits name dnsmkl for helping with diffing temporary files, and Starli0n for merging the ST2 and ST3 branches into one branch and for adding the Diff file with previous feature. The merge note is worth knowing if you are coming from an older version: the ST2 and ST3 lines have been combined, so there is one branch rather than two.

The plugin is written by Colin T.A. Gray, with contributions from Sebastian Pape and Jiri Urban, whose name also appears in the package manifest description.

Where FileDiffs is the wrong choice

The first limitation is that it only shows differences. Every command opens a diff view and stops there. There is no apply, no merge and no patch application, so if you want to take the clipboard version and write it over the file, you copy and paste it yourself. For a package named FileDiffs that is the right scope, and it is worth stating plainly so nobody buys it expecting a merge tool.

The second is that it lives inside Sublime Text, so the comparison is between what the editor knows. The clipboard diff reads the system clipboard, but the file diff works against a file that is in the current project, and the tab diff against an open file, and the previous diff against the previously activated file. Comparing a buffer against a file on disk that is not open in the project is not in the command list, which is a narrower set than a general diff tool offers.

The third is the temporary file mechanism. Comparing a buffer to something requires materialising both sides, and the plugin does that by writing files. That works, and the privacy-conscious location and the 15 second cleanup are thoughtful, but it does mean the plugin touches the filesystem on every diff involving a buffer, and on a system with aggressive antivirus or full disk encryption that can be slower than the diff itself.

The fourth is the build floor. The manifest requires Sublime Text 3000 or newer, so anyone on Sublime Text 2 has no path to this package. The credits mention that the ST2 and ST3 branches were merged into one, which suggests the old line existed, and the fact that it is gone now is the practical consequence.

The fifth is the maintenance state. The last push was on 2026-04-29, the repository publishes no GitHub releases, and the licence is one GitHub cannot classify, with a LICENSE file in the repository root. For a plugin that does one thing and does it with a single Python file, that is a low-risk dependency. For a team standardising on it, the lack of a release history and a clearly identified licence are the two things to resolve before committing.

Editorial conclusion

FileDiffs fits a Sublime Text user who works with pasted fragments and wants to see exactly what differs between the clipboard, the saved file and the buffer on screen, since the commands cover all of those comparisons. It is the wrong choice if you want a merge tool, since the package only shows diffs, and it is the wrong choice if you are on a Sublime Text build older than 3000, because the manifest requires that version. Before installing, note that the plugin writes temporary files into your Data/Packages folder rather than the system temp directory for the sake of portable installations, and that the last push was on 2026-04-29 with the repository publishing no GitHub releases.

Frequently asked questions

What does the Sublime Text FileDiffs plugin do?

It shows diffs between the current file or the current selection and the clipboard, another file in the project, the saved version of the file, the previously activated file or the first and second selected regions. It can also hand the comparison to an external diff tool.

How do I install FileDiffs in Sublime Text?

Use Package Control and install FileDiffs, or clone the repository into your packages folder. The package manifest requires Sublime Text 3000 or newer, and the readme recommends adding key bindings for the commands, with the examples in the repository's Example.sublime-keymap.

How do I configure FileDiffs to use an external diff tool?

Open Preferences, then Package Settings, then FileDiffs, then Settings - Default, and uncomment an example or write your own command. The command may need a full path such as /usr/local/bin/ksdiff if it is not in your PATH, and the settings support platform-specific overrides and environment variable expansion for the cmd parameter.

Where does FileDiffs put its temporary files?

In your Data/Packages folder rather than the system temp folder, because of privacy concerns for portable Sublime Text installations, and the temporary files are removed automatically after 15 seconds.

What licence is FileDiffs released under?

The licence field on the repository records a custom licence that GitHub cannot classify, with the terms in the LICENSE file at the root of the repository. The last push was on 2026-04-29 and the repository publishes no GitHub releases.

Official sources

  1. colinta/SublimeFileDiffs on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/colinta-sublimefilediffs.svg)](https://hysenlabs.com/projects/colinta-sublimefilediffs)

Was this useful?