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

Style​Token​Highlighter

by leoshome ALL New

A Sublime Text plugin that adds Notepad++'s "Style all occurrences of token" and occurrence navigation features.

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

Style Token Highlighter

A Sublime Text plugin that adds Notepad++'s “Style all occurrences of token” feature. Highlight tokens with 9 color styles and navigate between occurrences.

Features

  • 9 Color Styles: Highlight different tokens simultaneously using standard syntax scopes (String, Comment, Keyword, etc.).
  • Smart Go: Jump to the Next or Previous same highlight of a token.
  • Granular Control: Clear specific styles or wipe all highlights with one click.

Screenshots

Highlighting Tokens

Select a word, right-click, and choose a style. All occurrences will be highlighted.

Highlighting Demo

Installation

Via Package Control (Coming Soon)

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  2. Select Package Control: Install Package.
  3. Search for StyleTokenHighlighter and press Enter.

Usage

All commands are available via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and the right-click context menu:

  1. Highlight: Select a word → Right-click → Style Token Highlighter → Choose a style (1-9)
  2. Toggle: Select a word → Command Palette → StyleToken: Toggle Highlight (Auto Style) (auto-picks next available style)
  3. Go: Place cursor on a highlighted token → Right-click → Go to Next/Previous Same Style
  4. Clear: Right-click → Clear Specific Style or Clear All Style

Settings

You can customize the highlight colors via Preferences > Package Settings > StyleTokenHighlighter > Settings.

The colors array accepts any valid Sublime Text scope name. Default:

{
    "colors": [
        "string",
        "comment",
        "keyword",
        "constant",
        "support.function",
        "variable",
        "entity.name.class",
        "invalid",
        "storage.type"
    ]
}

Changing Colors

Replace any scope name with a different one. The actual color depends on your color scheme (e.g., Monokai, Mariana). Common scopes:

Scope Typical Color
string Green
comment Gray
keyword Purple/Blue
constant Orange
constant.numeric Orange
variable Red
entity.name.function Blue
entity.name.class Yellow
entity.name.tag Red
support.function Blue
storage.type Purple
invalid Red background
markup.heading Bold
punctuation White/Gray
constant.character.escape Cyan

Adding More Colors

Add more items to the array — there's no limit. Style 10, 11, 12… will become available automatically:

{
    "colors": [
        "string",
        "comment",
        "keyword",
        "constant",
        "support.function",
        "variable",
        "entity.name.class",
        "invalid",
        "storage.type",
        "entity.name.function",
        "entity.name.tag",
        "constant.numeric"
    ]
}

Finding Available Scopes

To see what scopes are available in your color scheme:

  1. Place the cursor on any word in your code
  2. Press Ctrl+Alt+Shift+P (Windows/Linux) or Cmd+Alt+Shift+P (macOS)
  3. The status bar shows the scope at that position (e.g., source.python keyword.control)

Use these scope names in your colors array.

Key Bindings

This package doesn't ship key bindings to avoid conflicts with your existing shortcuts. To set up your own, open Preferences > Key Bindings and copy the examples below. Customize the key combinations to your liking.

// Toggle highlight (auto-picks next available style)
{ "keys": ["primary+k", "primary+h"], "command": "style_token_toggle_highlight" },

// Highlight with specific style (color_index 0-8)
{ "keys": ["primary+k", "primary+1"], "command": "style_token_highlight", "args": {"color_index": 0} },
{ "keys": ["primary+k", "primary+2"], "command": "style_token_highlight", "args": {"color_index": 1} },
{ "keys": ["primary+k", "primary+3"], "command": "style_token_highlight", "args": {"color_index": 2} },
{ "keys": ["primary+k", "primary+4"], "command": "style_token_highlight", "args": {"color_index": 3} },
{ "keys": ["primary+k", "primary+5"], "command": "style_token_highlight", "args": {"color_index": 4} },
{ "keys": ["primary+k", "primary+6"], "command": "style_token_highlight", "args": {"color_index": 5} },
{ "keys": ["primary+k", "primary+7"], "command": "style_token_highlight", "args": {"color_index": 6} },
{ "keys": ["primary+k", "primary+8"], "command": "style_token_highlight", "args": {"color_index": 7} },
{ "keys": ["primary+k", "primary+9"], "command": "style_token_highlight", "args": {"color_index": 8} },

// Navigate between highlights
{ "keys": ["primary+k", "primary+n"], "command": "style_token_go_next" },
{ "keys": ["primary+k", "primary+p"], "command": "style_token_go_prev" },

// Clear all highlights
{ "keys": ["primary+k", "primary+0"], "command": "style_token_clear_all_highlight" }

Note: primary maps to Ctrl on Windows/Linux and Cmd on macOS.

For more information on key bindings, see the Sublime Text documentation.

Context Menu

This package ships a context menu by default. To customize or disable it:

  1. Open the Packages directory (via Preferences > Browse Packages…).
  2. Create a StyleTokenHighlighter directory inside it (if it doesn't exist).
  3. Create a Context.sublime-menu file in that directory.

To disable the context menu completely, put this in the file:

[]

To customize it, copy the original menu and remove or modify the entries you don't need.

Your copy overrides the one shipped with the package. See the official documentation for more details.


Attribution

This plugin was written with AI assistance and reviewed by the author.

License

This project is licensed under the MIT License - see the LICENSE file for details.

License: MIT