/ST-RainbowIndent

Makes indentation easier to read.

Primary LanguagePythonMIT LicenseMIT

ST-RainbowIndent

Required ST Build GitHub Actions Package Control GitHub tag (latest by date) Project license GitHub stars Donate to this project using Paypal

Makes indentation easier to read.

This is a simple conceptual clone of the Indent Rainbow VSCode extension.

Installation

This plugin is not published on Package Control (yet?).

To install this plugin via Package Control, you have to add a custom repository.

  1. Execute Package Control: Add Repository in the command palette.
  2. Add this custom repository: https://raw.githubusercontent.com/jfcherng-sublime/ST-my-package-control/master/repository.json
  3. Restart Sublime Text.
  4. You should be able to install this package with Package Control with the name RainbowIndent.

Demo

Colors can be customized in plugin settings and your color scheme.

screenshot

Example Color Scheme Rules

You may add following rules into your color scheme.

///////////////////
// RainbowIndent //
///////////////////
{
    // red
    "foreground": "rgba(229, 57, 53, 0.35)",
    "background": "rgba(229, 57, 53, 0.2)",
    "scope": "region.indent.0",
},
{
    // green
    "foreground": "rgba(67, 160, 71, 0.35)",
    "background": "rgba(67, 160, 71, 0.2)",
    "scope": "region.indent.1",
},
{
    // blue
    "foreground": "rgba(30, 136, 229, 0.35)",
    "background": "rgba(30, 136, 229, 0.2)",
    "scope": "region.indent.2",
},
{
    // orange
    "foreground": "rgba(251, 140, 0, 0.35)",
    "background": "rgba(251, 140, 0, 0.2)",
    "scope": "region.indent.3",
},
{
    // purple
    "foreground": "rgba(142, 36, 170, 0.35)",
    "background": "rgba(142, 36, 170, 0.2)",
    "scope": "region.indent.4",
},
{
    // cyan
    "foreground": "rgba(0, 172, 193, 0.35)",
    "background": "rgba(0, 172, 193, 0.2)",
    "scope": "region.indent.5",
},

And use the following plugin setting.

"level_colors": [
    "region.indent.0",
    "region.indent.1",
    "region.indent.2",
    "region.indent.3",
    "region.indent.4",
    "region.indent.5",
],

Known Issues

  • There is no way to draw a region, where there is nothing, via ST's plugin APIs.
  • Sometimes, ST seems to draw regions wrongly. Not sure how to stably reproduce this.