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 322K
  • Win 175K
  • Mac 97K
  • Linux 50K
Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6
Windows 1 10 11 9 6 9 4 4 19 7 9 15 14 13 8 9 5 7 17 7 8 10 9 13 14 8 13 10 7 13 12 13 15 15 4 7 6 15 13 14 13 8 9 13 12 21
Mac 1 8 11 14 11 13 3 5 10 7 10 11 9 4 7 4 11 11 6 5 5 9 8 15 13 14 8 6 7 7 10 15 13 7 4 1 6 17 11 18 7 3 5 13 12 13
Linux 0 2 6 4 3 2 1 0 6 2 2 4 2 3 1 5 2 4 2 2 0 3 4 2 2 5 2 0 2 9 1 3 2 1 2 4 1 2 0 1 3 0 2 0 4 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