Highlight Token
Sublime Text plugin for highlighting text, with persistence and user scopes and colors.
Details
Installs
- Total 317
- Win 243
- Mac 0
- Linux 74
| Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Highlight Token
Sublime Text plugin to do text color highlighting per document. Loosely based on the old StyleToken.
Built for ST4 on Windows. Linux and OSX should be ok but are minimally tested - PRs welcome.
Features
- Select some text and right click to select one of six highlight colors. Select whole word by placing the caret at the start of the word.
- Other options clear the highlights in the current file or all.
- To refresh highlighting while editing, save the file.
- Persisted to
.../Packages/User/HighlightToken/HighlightToken.store. - Utilities to show colorized list of the scopes at the caret, or all scopes in the view. Handy when selecting the highlight colors.
- After editing
your.sublime-color-scheme, refresh by close/reopen affected views. May be improved in the future.

Commands and Menus
| Command | Description | Args |
|---|---|---|
| sbot_highlight_text | Highlight text | hl_index: scope markup.user_hl1 - 6 |
| sbot_clear_highlights | Remove highlights in file | |
| sbot_clear_all_highlights | Remove all highlights | |
| sbot_current_highlights | Show current file highlights | |
| sbot_scope_info | Show scopes at caret in color | |
| sbot_all_scopes | Show all scopes in view |
There is no default Context.sublime-menu file in this plugin.
Add the commands you like to your own User/Context.sublime-menu file. Typical entries are:
{ "caption": "HL 1", "command": "sbot_highlight_text", "args" : {"hl_index" : "0"} },
{ "caption": "HL 2", "command": "sbot_highlight_text", "args" : {"hl_index" : "1"} },
{ "caption": "Highlight",
"children":
[
{ "caption": "HL 3", "command": "sbot_highlight_text", "args" : {"hl_index" : "2"} },
{ "caption": "HL 4", "command": "sbot_highlight_text", "args" : {"hl_index" : "3"} },
{ "caption": "HL 5", "command": "sbot_highlight_text", "args" : {"hl_index" : "4"} },
{ "caption": "HL 6", "command": "sbot_highlight_text", "args" : {"hl_index" : "5"} },
{ "caption": "-" },
{ "caption": "Clear All Highlights", "command": "sbot_clear_all_highlights" },
{ "caption": "Current Highlights", "command": "sbot_current_highlights" },
{ "caption": "Scope Info", "command": "sbot_scope_info" },
{ "caption": "All Scopes", "command": "sbot_all_scopes" },
]
},
{ "caption": "Clear File Highlights", "command": "sbot_clear_highlights" },
Settings
| Setting | Description | Options |
|---|---|---|
| scopes_to_show | Extra scopes to show besides default. |
Colors
New scopes have been added to support this application. Adjust these to taste and add
to your Packages/User/your.sublime-color-scheme file.
Note that these are shared with the Notr and Render View packages.
{ "scope": "markup.user_hl1", "background": "red", "foreground": "white" },
{ "scope": "markup.user_hl2", "background": "green", "foreground": "white" },
{ "scope": "markup.user_hl3", "background": "blue", "foreground": "white" },
{ "scope": "markup.user_hl4", "background": "yellow", "foreground": "black" },
{ "scope": "markup.user_hl5", "background": "lime", "foreground": "black" },
{ "scope": "markup.user_hl6", "background": "cyan", "foreground": "black" },
Notes
Some ST quirks:
- The way ST works, you have to define which scope to use for each of the different highlights.
- Coloring for
markup.user_hlsonly supports fore and back colors, unfortunately not font_style. - Regions added by
self.view.add_regions()cannot set the foreground color. The scope color is used for the region background color. Also they are not available viaextract_scope()“.
sbot_common.pycontains miscellaneous common components primarily for internal use by the sbot family. This includes a very simple logger primarily for user-facing information, syntax errors and the like. Log file is in<ST_PACKAGES_DIR>/User/HighlightToken/HighlightToken.log.If you pull the source it must be in a directory named
Highlight Tokenrather than the repo name. This is to satisfy PackageControl naming requirements.