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

Highlight Duplicates

by LordBrom ST2/ST3

Highlight duplicated lines in SublimeText 3

Details

Installs

  • Total 3K
  • Win 2K
  • OS X 963
  • Linux 418
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 Dec 22 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
Windows 8 1 1 0 2 4 6 8 3 3 1 5 3 7 4 7 2 6 1 5 7 12 2 1 4 8 13 11 8 5 0 4 8 14 5 3 6 2 2 0 1 6 5 3 1 2
OS X 1 2 1 2 1 1 3 3 2 0 0 0 1 3 4 3 0 1 0 2 3 3 0 0 0 3 5 5 5 7 1 1 6 5 3 2 3 0 0 5 3 2 2 2 1 2
Linux 0 3 0 1 6 1 0 1 0 2 0 2 2 1 1 3 0 1 2 0 3 3 0 0 2 1 5 2 3 2 1 1 1 2 4 1 0 0 0 3 0 0 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

Highlight Duplicates

Highlight duplicated lines. This is a Sublime Text 3 plugin.

Installation

Go to your Packages subdirectory under ST3's data directory:

  • Windows: %APPDATA%\Sublime Text 3
  • OS X: ~/Library/Application Support/Sublime Text 3/Packages
  • Linux: ~/.config/sublime-text-3
  • Portable Installation: Sublime Text 3/Data

Then clone this repository:

git clone git://github.com/lordbrom/HighlightDuplicates.git

That's it!

Commands

Toggle Highlighting

Using this command will turn the plugin on and off. Allowing you to only see the highlighted duplicates when you want, without having to disable/enable to plugin via the Package Control.

Select Duplicates

Using this command will select the rows that would be highlighted when Highlight Duplicates is toggled on. The duplicate rows do not need to be highlighted in order for this command to work.

Options

Some options are available to customize the plugin look 'n feel. The config keys goes into config files accessible throught the “Preferences” menu.

Change the highlighting color

The highlighting color can be changed by providing a scope name such as “invalid”, “comment”… in “File Settings - User”:

{ "highlight_duplicates_color": "invalid" }

“invalid” is the default value. If you'd like to use a custom color, it should be defined as a color scope in your theme file.

Ignore white space

If this setting is true, the leading and trailing whitespace will be removed before being compared to other lines. This setting also affects which lines are selected when using the 'Select Duplicates' command. For example, if "ignore_white_space" : true the following 2 lines will be counted as duplicates. “ 1: 2:

However, these lines would not, since there is white space in line 1, that is not leading or trailing  whitespace, which is not in line 2.

1: 2:

``` js
{ "ignore_white_space" : true }
// or
{ "ignore_white_space" : false }

Run it

As soon as it's installed, it's working. Then, you can toggle the highlighting with Tools > Command Palette (command + shift + p on OSX) and start typing duplicates. Select the command in the list and hit enter.