ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

File​Diffs

by Colin T.A. Gray (colinta) ST3 Trending Top 100

Shows diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes. With contributions from Sebastian Pape (spape) and Jiri Urban (jiriurban)

Labels diff/merge

Details

Installs

  • Total 330K
  • Win 179K
  • Mac 100K
  • Linux 51K
Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18
Windows 0 11 5 15 15 27 18 17 6 8 16 19 24 9 8 6 6 12 20 16 21 15 7 9 12 12 13 16 13 4 10 3 0 0 0 1 0 0 0 1 1 0 0 0 0 0
Mac 2 8 6 23 14 12 16 14 7 7 11 18 20 6 10 4 2 18 14 11 20 18 8 2 21 12 15 13 16 7 8 6 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Linux 0 0 1 4 6 7 1 6 0 2 1 6 4 1 2 3 1 1 3 2 3 4 4 2 3 5 3 3 5 4 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
010203040Jun 2May 30May 27May 24May 21May 18May 15May 12May 9May 6May 3Apr 30Apr 27Apr 24Apr 21Apr 18Jun 2 Linux: 0 Mac: 2 Windows: 0Jun 1 Linux: 0 Mac: 8 Windows: 11May 31 Linux: 1 Mac: 6 Windows: 5May 30 Linux: 4 Mac: 23 Windows: 15May 29 Linux: 6 Mac: 14 Windows: 15May 28 Linux: 7 Mac: 12 Windows: 27May 27 Linux: 1 Mac: 16 Windows: 18May 26 Linux: 6 Mac: 14 Windows: 17May 25 Linux: 0 Mac: 7 Windows: 6May 24 Linux: 2 Mac: 7 Windows: 8May 23 Linux: 1 Mac: 11 Windows: 16May 22 Linux: 6 Mac: 18 Windows: 19May 21 Linux: 4 Mac: 20 Windows: 24May 20 Linux: 1 Mac: 6 Windows: 9May 19 Linux: 2 Mac: 10 Windows: 8May 18 Linux: 3 Mac: 4 Windows: 6May 17 Linux: 1 Mac: 2 Windows: 6May 16 Linux: 1 Mac: 18 Windows: 12May 15 Linux: 3 Mac: 14 Windows: 20May 14 Linux: 2 Mac: 11 Windows: 16May 13 Linux: 3 Mac: 20 Windows: 21May 12 Linux: 4 Mac: 18 Windows: 15May 11 Linux: 4 Mac: 8 Windows: 7May 10 Linux: 2 Mac: 2 Windows: 9May 9 Linux: 3 Mac: 21 Windows: 12May 8 Linux: 5 Mac: 12 Windows: 12May 7 Linux: 3 Mac: 15 Windows: 13May 6 Linux: 3 Mac: 13 Windows: 16May 5 Linux: 5 Mac: 16 Windows: 13May 4 Linux: 4 Mac: 7 Windows: 4May 3 Linux: 0 Mac: 8 Windows: 10May 2 Linux: 2 Mac: 6 Windows: 3May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 0Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 1Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 1Apr 23 Linux: 0 Mac: 0 Windows: 1Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 0 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 0Jun 2 Linux: 0 Mac: 2 Windows: 0Jun 1 Linux: 0 Mac: 8 Windows: 11May 31 Linux: 1 Mac: 6 Windows: 5May 30 Linux: 4 Mac: 23 Windows: 15May 29 Linux: 6 Mac: 14 Windows: 15May 28 Linux: 7 Mac: 12 Windows: 27May 27 Linux: 1 Mac: 16 Windows: 18May 26 Linux: 6 Mac: 14 Windows: 17May 25 Linux: 0 Mac: 7 Windows: 6May 24 Linux: 2 Mac: 7 Windows: 8May 23 Linux: 1 Mac: 11 Windows: 16May 22 Linux: 6 Mac: 18 Windows: 19May 21 Linux: 4 Mac: 20 Windows: 24May 20 Linux: 1 Mac: 6 Windows: 9May 19 Linux: 2 Mac: 10 Windows: 8May 18 Linux: 3 Mac: 4 Windows: 6May 17 Linux: 1 Mac: 2 Windows: 6May 16 Linux: 1 Mac: 18 Windows: 12May 15 Linux: 3 Mac: 14 Windows: 20May 14 Linux: 2 Mac: 11 Windows: 16May 13 Linux: 3 Mac: 20 Windows: 21May 12 Linux: 4 Mac: 18 Windows: 15May 11 Linux: 4 Mac: 8 Windows: 7May 10 Linux: 2 Mac: 2 Windows: 9May 9 Linux: 3 Mac: 21 Windows: 12May 8 Linux: 5 Mac: 12 Windows: 12May 7 Linux: 3 Mac: 15 Windows: 13May 6 Linux: 3 Mac: 13 Windows: 16May 5 Linux: 5 Mac: 16 Windows: 13May 4 Linux: 4 Mac: 7 Windows: 4May 3 Linux: 0 Mac: 8 Windows: 10May 2 Linux: 2 Mac: 6 Windows: 3May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 0Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 1Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 1Apr 23 Linux: 0 Mac: 0 Windows: 1Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 0 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 0Jun 2 Linux: 0 Mac: 2 Windows: 0Jun 1 Linux: 0 Mac: 8 Windows: 11May 31 Linux: 1 Mac: 6 Windows: 5May 30 Linux: 4 Mac: 23 Windows: 15May 29 Linux: 6 Mac: 14 Windows: 15May 28 Linux: 7 Mac: 12 Windows: 27May 27 Linux: 1 Mac: 16 Windows: 18May 26 Linux: 6 Mac: 14 Windows: 17May 25 Linux: 0 Mac: 7 Windows: 6May 24 Linux: 2 Mac: 7 Windows: 8May 23 Linux: 1 Mac: 11 Windows: 16May 22 Linux: 6 Mac: 18 Windows: 19May 21 Linux: 4 Mac: 20 Windows: 24May 20 Linux: 1 Mac: 6 Windows: 9May 19 Linux: 2 Mac: 10 Windows: 8May 18 Linux: 3 Mac: 4 Windows: 6May 17 Linux: 1 Mac: 2 Windows: 6May 16 Linux: 1 Mac: 18 Windows: 12May 15 Linux: 3 Mac: 14 Windows: 20May 14 Linux: 2 Mac: 11 Windows: 16May 13 Linux: 3 Mac: 20 Windows: 21May 12 Linux: 4 Mac: 18 Windows: 15May 11 Linux: 4 Mac: 8 Windows: 7May 10 Linux: 2 Mac: 2 Windows: 9May 9 Linux: 3 Mac: 21 Windows: 12May 8 Linux: 5 Mac: 12 Windows: 12May 7 Linux: 3 Mac: 15 Windows: 13May 6 Linux: 3 Mac: 13 Windows: 16May 5 Linux: 5 Mac: 16 Windows: 13May 4 Linux: 4 Mac: 7 Windows: 4May 3 Linux: 0 Mac: 8 Windows: 10May 2 Linux: 2 Mac: 6 Windows: 3May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 0Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 1Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 0 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 1Apr 23 Linux: 0 Mac: 0 Windows: 1Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 0 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 0

Readme

Source
raw.​githubusercontent.​com

FileDiffs Plugin

Shows diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes. Can be configured to show diffs in an external diff tool

Preview


Help!

Check the wiki for more tips

Installation

Using Package Control, install FileDiffs or clone this repo in your packages folder.

I recommended you add key bindings for the commands. I've included my preferred bindings below. Copy them to your key bindings file (⌘⇧,).

Add External Diff Tool (optional)

(IMPORTANT: You might need to make a symlink (e.g. in /usr/local/bin) pointing to the command line tool of your external diff tool)

  1. Preferences > Package Settings > FileDiffs > Settings - Default

  2. Uncomment one of the examples or write your own command to open external diff tool.

This command may need to be a full path (e.g. /usr/local/bin/ksdiff), if the command isn't in your PATH.

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
  • Environment variable expansions for cmd parameter in the settings

Commands

file_diff_menu: Shows a menu to select one of the file_diff commands. If you use the bindings in Example.sublime-keymap, this is bound to ctrl+shift+d.

The rest of the commands do not need to be bound (accessible from the menu):

file_diff_clipboard: Shows the diff of the current file or selection(s) and the clipboard (the clipboard is considered the “new” file unless reverse is True)

file_diff_selections: Shows the diff of the first and second selected regions. The file_diff_menu command checks for exactly two regions selected, otherwise it doesn't display this command.

file_diff_saved: Shows the diff of the current file or selection(s) and the saved file.

file_diff_file: Shows the diff of the current file or selection(s) and a file that is in the current project.

file_diff_tab: Shows the diff of the current file or selection(s) and an open file (aka a file that has a tab).

file_diff_previous: Shows the diff of the current file or selection(s) and the previous activated file. If a file is not saved yet, dirty buffer is used instead of reading from disk.

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

Key Bindings

Copy these to your user key bindings file.

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

Contributors

Thanks to:

  • Sebastian Pape for adding support for using an external diff tool
  • Starli0n for merging the ST2 and ST3 branches into one branch,
  • and for adding the “Diff file with previous” feature
  • dnsmkl for helping with diffing temporary files