Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command to toggle indent rainbows? #11

Open
jots opened this issue Jul 3, 2016 · 4 comments
Open

command to toggle indent rainbows? #11

jots opened this issue Jul 3, 2016 · 4 comments

Comments

@jots
Copy link

jots commented Jul 3, 2016

Is it feasible to hook up a keystroke to toggle the rainbows on and off?

@oderwat
Copy link
Owner

oderwat commented Jul 3, 2016

Whats the reasoning behind it: Aesthetics or performance?

@oderwat oderwat closed this as completed Oct 7, 2017
@obahareth
Copy link

I need this as well, for aesthetic reasons. Indent rainbow is very helpful, but I don't need it all of the time. Sometimes all the colors can get distracting.

@oderwat oderwat reopened this Sep 10, 2018
@Ovyerus
Copy link

Ovyerus commented Oct 10, 2018

I agree. I only really need this when I'm cleaning up loose indents or working with something like Python, and having a command to easily toggle this on and off would be a major quality of life improvement IMO.

@oderwat
Copy link
Owner

oderwat commented Oct 10, 2018

A first step would be to only activate it for the languages you want to use it for.

"indentRainbow.includedLanguages": ["python", "json"]

Or disable it for some:

"indentRainbow.excludedLanguages": ["plaintext"]

Another way could be using a hotkey to toggle settings. This can be done with the "toggle" extension.

https://marketplace.visualstudio.com/items?itemName=rebornix.toggle

And set up a Key similar to this:

                              {
                                "key": "F4",
                                "command": "toggle",
                                "when": "editorTextFocus",
                                "args": {
                                  "id": "indentRainbow",
                                  "value": [
                                    {
                                      "indentRainbow.includedLanguages": []
                                    },
                                    {
                                      "indentRainbow.includedLanguages": ["none"]
                                    },
                                  ]
                                }
                              }

But this will only update the window if the editor switches between files (indent-rainbow does not check it's settings for every keypress).

I agree that a hotkey which lets you switch between "configured languages", "all" and "none" is useful and may implement this "some day".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants