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

File​Diffs

by Colin T.A. Gray (colinta) ST3 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 327K
  • Win 178K
  • Mac 99K
  • Linux 50K
Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6
Windows 2 12 19 20 18 12 7 8 14 15 12 20 11 3 10 22 13 18 16 9 3 2 12 5 0 0 0 3 6 16 19 9 6 11 9 5 14 0 0 19 8 10 9 18 17 16
Mac 10 17 9 16 18 9 6 5 18 12 12 16 10 7 6 14 12 16 11 20 4 5 6 10 0 0 0 1 3 14 19 7 2 13 8 6 13 0 0 18 11 5 6 14 7 16
Linux 0 4 4 4 4 7 1 0 1 3 5 4 3 2 2 5 3 2 6 3 0 0 7 2 0 0 0 0 2 4 3 3 0 4 3 1 4 0 0 1 2 0 2 4 1 2

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

Package Control (Easiest)

  1. Using Package Control, install FileDiffs

  2. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)

Sublime Text 3

  1. Open the Sublime Text Packages folder

    • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
    • Windows: %APPDATA%/Sublime Text 3/Packages/
    • Linux: ~/.Sublime Text 3/Packages/ or ~/.config/sublime-text-3/Packages
  2. Clone this repo

    # Over SSH
    git clone git@github.com:colinta/SublimeFileDiffs
    
    # Over HTTPS
    git clone https://github.com/colinta/SublimeFileDiffs.git
    
  3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)

Sublime Text 2

  1. Open the Sublime Text 2 Packages folder
  2. Clone this repo, but use the st2 branch

    # Over SSH
    git clone -b st2 git@github.com:colinta/SublimeFileDiffs
    
    # Over HTTPS
    git clone -b st2 https://github.com/colinta/SublimeFileDiffs.git
    

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.

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