-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Indent guides #11503
Indent guides #11503
Conversation
It looks great, I hope it can have built-in rainbow indentation :) |
Co-Authored-By: Nate Butler <[email protected]>
@d1y It is actually built-in. In your settings file you will be able to do something like this: "experimental.theme_overrides": {
"accents": [ // Specify some accent colors to use for the indent guide lines/background
"#ffff40",
"#7fff7f",
"#ff7fff",
"#4fecec"
]
},
"indent_guides": {
"coloring": "indent_aware", // Set this to indent_aware to paint the lines in rainbow colors
"background_coloring": "indent_aware" // Set this to indent_aware to paint the background in rainbow colors
}, You can also only colorize/disable the lines/the background by customizing the |
@bennetbo Great work! For the "fixed" color mode is there a way to set the color of the active and inactive indent guides via the theme? I see an example for the gruvbox theme accents, but thinking that is only for "indent_aware" colors. What I would be shooting for is to set the "active" indent guide to a more prominent color (maybe) and the inactive guides to transparent. Regardless of whether that is in here this will be a great addition. Thanks! |
The other notes for future consideration are:
I'm not even sure I'd want to mess with the default active/inactive theme colors mentioned in my previous comment if these sorts of settings were available. |
@baldwindavid Indent guides use the theme color's |
@bennetbo Super cool. I added I also see that you went ahead and added the per language config. I tried it out and quickly realized that my plan to disable for Elixir is kind of foiled in that this also disables it for heex (the elixir HTML template language). I tried this, but didn't seem to achieve what I was trying to do as the guides are still disabled for heex... "languages": {
"Elixir": {
"language_servers": ["lexical", "!elixir-ls", "!next-ls", "..."],
"indent_guides": {
"enabled": false
}
},
"HEEX": {
"indent_guides": {
"enabled": true
}
}, At any rate, don't think that has anything to do with this PR as the language-level settings do work. Thanks! |
I am not familiar with HEEX and elixir, is the HEEX code in the same file as the elixir code? Right now there's no support for rendering indent guides only for a certain part of a file (the language settings get inferred from the first line of the buffer, which in your case is probably elixir -> that's why they don't show up) |
Elixir is the main language and HEEX a templating language for Elixir. They are both in the elixir extension within the zed repo. While the elixir extension does support heex injections, the scenario I'm talking about here is for elixir in a file with a |
Hmm that is odd, I just tested it and specifying something like tab_size will also not work, HEEX always seems to use the settings that I specify for elixir |
Builds on top of existing work from #2249, but here's a showcase:
Screen.Recording.2024-05-07.at.19.01.44.mov
TODO:
find_active_indent_index
)Release Notes: