Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Symbol MasksNew to Visual Studio Code? Get it now.
Symbol Masks

Symbol Masks

sporiley

|
4,494 installs
| (1) | Free
Mask symbols in your document with prettier text
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Symbol Masks

Mask symbols in your code with custom styles and replacement text.

Demo

Prerequisites

Windows

You will need to install Windows Build Tools before installing this extension for it to work properly.

Usage

Specify a pattern that will match a symbol to be masked in your settings.json file:

"symbolMasks.masks": [
  {
    "language": "plaintext",
    "patterns": [
        {
            "pattern": "(?<=\\b)lambda(?=\\b)",
            "replace": "value": "λ",
            "style": {
              "fontWeight": "bold"
            }
        }
    ]
  }
]

Mask Multiple Symbols At Once

For efficiency, you can also match many symbols at once and map each of them to an individual mask:

"symbolMasks.masks": [
  {
    "language": "plaintext",
    "patterns": [
        {
            "pattern": "(?<=\\b)(lambda|omega)(?=\\b)",
            "replace": {
              "lambda": {
                  "value": "λ",
                  "fontWeight": "bold"
              },
              "omega": {
                  "value": "ω"
              }
            }
        }
    ]
  }
]

Mask Based On TextMate Scope

Creating more intelligent masks is as simple as specifying a textmate scope the mask should look for. This can be done in both single and multiple masking mode:

"symbolMasks.masks": [
  {
    "language": "typescript",
    "patterns": [
      {
        "pattern": "!==|!=",
        "replace": {
          "!=": {
            "scope": "keyword.operator.comparison",
            "text": "≉"
          },
          "!==": {
              "scope": "keyword.operator.comparison",
              "text": "≢"
          }
        }
      }
    ]
  }
]

The result:

Scope Based Masking

Since the !== in the comment does not match the specified scope, it doesn't get masked.

To find find the scopes for a given symbol, simply run Ctrl+Shift+P and the command Developer: Inspect Editor Tokens and Scopes:

Inspect Tokens

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft