Clipboard Diff
SublimeText plugin to diff your clipboard against the current selection
Details
Installs
- Total 9K
- Win 4K
- Mac 3K
- Linux 1K
Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 |
Linux | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
sublime-clipboard-diff
SublimeText plugin to diff your clipboard against the current selection
Clipboard Diff on Package Control
Usage:
- Copy something to the clipboard
- Select something you want to compare the clipboard to
- Press:
OS | Key Combination |
---|---|
Linux | ctrl + alt + D |
Mac | super(⌘) + alt + ctrl + D |
Windows | ctrl + alt + D |
You can also run it from the Command Palette (ctrl + shift + P
) followed by "Clipboard Diff"
. The same command is also available from the “Context Menu” (right clicking on a text area).
Installation
The easiest way to install Clipboard Diff
is to install it from Package Control
Package Control Install
If you have Package Control installed, then simply naviagte to Package Control: Install Package
and select the Clipboard Diff
plugin and you are done!
Manual Install
From SublimeText Packages
folder:
git clone git@github.com:sabhiram/sublime-clipboard-diff.git sublime-clipboard-diff
Settings & Default Key Mapping
Here is a list of settings exposed by Clipboard Diff:
// Setting the `diff_type` will allow the user to toggle the type
// of diff used in Clipboard Diff
//
// Here is a list of supported types as of now:
//
// 1. [Default] unified - Uses difflib.unified_diff(...)
// 2. context - Uses difflib.context_diff(...)
"diff_type": "unified",
// Setting the `clipboard_file_name` will allow the user to change the
// file name which shows up when the diff is run for the Clipboard
// contents.
"clipboard_file_name": "Clipboard",
// Setting the `selection_file_name` will allow the user to change the
// file name which shows up when the diff is run for the Selection
// contents.
"selection_file_name": "Selection"
To override any of these settings, simply create a file called clipboard_diff.sublime-settings
in the Packages\User
folder. Here is a sample:
more ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/clipboard_diff.sublime-settings
{
"diff_type": "context",
"clipboard_file_name": "Clipboard contents",
"selection_file_name": "Selected stuff..."
}
The above User specific setting file overrides the names which will be displayed when a diff is computed. It also demonstrates how we can change the diff_type
to a difflib.context_diff
as opposed to the default difflib.unified_diff
Developers
Appreciate the help! Here is stuff you should probably know:
Install for both Sublime Text 2 and 3:
Some folks prefer to clone the git repo right into their SublimeText Packages
folder. While this is probably ok for most users, I prefer to create a symbolic link to the package so that I can point to the plugin from both flavors of SublimeText (for testing and the like…)
cd ~/dev
git clone git@github.com:sabhiram/sublime-clipboard-diff.git sublime-clipboard-diff
ln -s sublime-clipboard-diff ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/sublime-clipboard-diff
ln -s sublime-clipboard-diff ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-clipboard-diff
Running Tests & CI
This project, and any pull requests will automatically be run against Travis CI. For local development, the tests assume that the following are installed and configured:
Hopefully you have Sublime Text installed
Next make sure you have Package Control installed as well (and you really should, it's awesome!)
Via the SublimeText Package Control, install the UnitTesting
package. You can do this by hitting ctrl + shift + p
, then select Package Control: Install Package
. Once the menu loads, choose the UnitTesting
package.
To run the tests: ctrl + shift + p
then select UnitTesting: Run any project test suite
and type in the name of this package (in my case, and typically sublime-clipboard-diff
but is basically the name of the folder which you chose to clone the repo into).
Sublime Text API Reference
Versions Released
1.2.0 - Future Release
- Add external diff tool
- … What would you like to see?
1.1.4 - Current Release
- Display appropriate message when the selection and clipboard match
1.1.3
- Adds Context menu item for “Clipboard Diff”
- Adds Command Palette entry for “Clipboard Diff”
1.1.2
- Minor update: add package control messages
- Prettify the plugin settings in the readme
1.1.1
- Minor bugfix with diff output view
1.1.0
- Adds syntax highlighting to diff output view
- Exposes settings to change
diff_type
and source / destination file names - Small bugfixes in helper functions which were never tested
- More tests to validate the above
1.0.0 - Initial Release
- Implements basic diff feature
- Adds simple tests for plugin functionality
- Ready for package control deployment