feat: colored/rainbow indentation guides#76
Merged
usagi-flow merged 3 commits intomainfrom Apr 13, 2025
Merged
Conversation
1d31b46 to
5e93dc6
Compare
commit b5bf68129b56dc0178a61b7e22151decf82a25da Merge: d1517c6a 207829e Author: SoraTenshi <dream@neoncity.dev> Date: Thu May 25 19:53:22 2023 +0200 Merge branch 'master' into colored-indent-guides commit d1517c6a4b9b09609df03d984f4e890ec1998c26 Author: SoraTenshi <dream@neoncity.dev> Date: Sun Feb 12 22:18:41 2023 +0100 Update to new TextRenderer Docs fmt commit 7f47756b6d3d9119e1e426d7df48221d9019265c Author: Michael Davis <mcarsondavis@gmail.com> Date: Mon Jul 11 19:10:57 2022 -0500 Parse rainbow style array in themes This change adds a field to the schema of themes which takes a list of styles. rainbow = ["red", "orange", "yellow", { modifiers = ["reversed"] }] [palette] red = "#ff0000" orange = "#ffa500" yellow = "#fff000" Normal style rules apply for each element in `rainbows`: you can use definitions from the palette and the full fg/bg/modifiers notation. Themes written with `rainbow` keys are not backwards compatible. Parsing errors will be generated for older versions of Helix attempting to use themes with `rainbow` keys. A default rainbow is provided with base16 colors. This change is made with rainbow pair characters (parens, brackets, etc.) in mind but it could also be used for other rainbow cosmetic elements like rainbow indent-guides.
5e93dc6 to
2909a53
Compare
usagi-flow
added a commit
that referenced
this pull request
Jul 31, 2025
* Squashed commit of the following: commit b5bf68129b56dc0178a61b7e22151decf82a25da Merge: d1517c6a 207829e Author: SoraTenshi <dream@neoncity.dev> Date: Thu May 25 19:53:22 2023 +0200 Merge branch 'master' into colored-indent-guides commit d1517c6a4b9b09609df03d984f4e890ec1998c26 Author: SoraTenshi <dream@neoncity.dev> Date: Sun Feb 12 22:18:41 2023 +0100 Update to new TextRenderer Docs fmt commit 7f47756b6d3d9119e1e426d7df48221d9019265c Author: Michael Davis <mcarsondavis@gmail.com> Date: Mon Jul 11 19:10:57 2022 -0500 Parse rainbow style array in themes This change adds a field to the schema of themes which takes a list of styles. rainbow = ["red", "orange", "yellow", { modifiers = ["reversed"] }] [palette] red = "#ff0000" orange = "#ffa500" yellow = "#fff000" Normal style rules apply for each element in `rainbows`: you can use definitions from the palette and the full fg/bg/modifiers notation. Themes written with `rainbow` keys are not backwards compatible. Parsing errors will be generated for older versions of Helix attempting to use themes with `rainbow` keys. A default rainbow is provided with base16 colors. This change is made with rainbow pair characters (parens, brackets, etc.) in mind but it could also be used for other rainbow cosmetic elements like rainbow indent-guides. * fix: avoid panic, properly set rainbow_length when loading theme * feat: define a rainbow palette for the catppuccin themes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage
This feature will be opt-in, i.e. disabled by default. Enable it in your
config.tomlas follows:Theming
A theme can define a rainbow palette as follows (e.g. by referencing palette colors):
If a theme does not define or inherit any rainbow palette, a standard color palette will be used.
In this PR the "catppuccin" themes define a custom rainbow palette.
Preview
catppuccin_macchiato:

catppuccin_latte:

image courtesy of the original PR author:

Known issues
Dimming does not work. If
rainbow-optionis set todim, it will likely act as if set tonormal.This pull request introduces colored indentation guides, a.k.a. rainbow indentation guides.
This is helix-editor/helix#4493 (which in turn was a continuation of helix-editor/helix#4056), squashed and rebased, and with conflicts resolved.
Note
This makes considerable changes in the upstream implementation, and may never be merged upstream. We may have to refactor this implementation in the near future to avoid further conflicts.
Suggested in #42.