SublimeText / WordHighlight

Highlight all copies of the currently selected word.
MIT License
180 stars 24 forks source link

What it does

This plugin highlights all copies of a word that's currently selected, or, optionally, highlights all copies of a word which currently has the insertion cursor upon it.

Additionally you may select all these words highlighted with ALT+ENTER, or also may append to the selection these words one by one similar to CTRL+D.

Install

The easiest method to install would be using Package Control. Ensure you have the latest by visiting that link, then open the command palette, type in "Install Package", and search for "WordHighLight".

Alternatively, to manually install go to your Packages subdirectory under ST's data directory, where X is the ST version:

Then clone this repository:

git clone git://github.com/SublimeText/WordHighlight.git

That's it!

Options

Under the Packages/WordHighlight sub-directory, edit the Word Highlight.sublime-settings file:

Selections

By default it provides the key ALT+ENTER to select all the words highlighted by this package (you may highlight multiple words and then select all the instances)

It also has two functions with no keymap defined, to mimic CTRL+D and CTRL+K, CTRL+D. You may decided to use the alternatives by adding (upon customization) the following to the keymap file (Packages/User/Default (Windows).sublime-keymap):

{ "keys": ["ctrl+enter"], "command": "select_highlighted_next_word", "context":
    [   { "key": "selection_empty", "operator": "equal", "operand": false },
        { "key": "setting.is_widget", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["ctrl+backspace"], "command": "select_highlighted_skip_last_word", "context":
    [   { "key": "selection_empty", "operator": "equal", "operand": false },
        { "key": "setting.is_widget", "operator": "equal", "operand": false }
    ]
},

License

See the file LICENSE