-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
feat(pack): added rainbow-delimiter.nvim integration for indent-blankline.nvim #899
feat(pack): added rainbow-delimiter.nvim integration for indent-blankline.nvim #899
Conversation
Review ChecklistDoes this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist: Proper conventional commit scoping:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please go trough your PR again
Apologies if I'm missing something obvious, but nothing seems to be off-spec from the contribution docs and comparing to other recent PRs? The only thing I can see is my preview image potentially throwing the github actions parser an error possibly? I can remove that if so, but I thought it would be valuable for a primarily visual UI update based plugin. Otherwise my PR title seems to be meeting standards (and is passing in CI). I don't mean to cause any additional work but I am a bit lost as to what needs fixing and would appreciate some guidance |
You’ve got some unessecary files |
05350de
to
d3667c0
Compare
Removed the accidental |
I'm not sure if this better fits a recipe. |
d3667c0
to
21bbf3f
Compare
Happy to move it there if that makes more sense--put it with indent to match the NeovimCraft category per the contribution docs |
21bbf3f
to
39ab80d
Compare
@ammuench Ok, I took a deep look at this today and have a recommendation on a different type of implementation for this that (1) greatly simplifies the implementation, (2) makes it much easier for the end user to further configure the plugins fully, (3) makes the end product a bit less distracting, and (4) adds full colorscheme support for any colorscheme that already supports Let me know what you think, I made sure this is in it's own commit so that it is quite easy to revert. This also lets us use the example image in the |
Oh, also I think the location makes sense, I changed the wording a bit to match how we do the multiple copilot entries. Another approach would be to make it a "pack" since it configures multiple plugins but it makes it a bit harder to find imo. Or we could invert it to be |
Then I think a pack makes more sense. Since it's multiple plugins being configured to work together |
2c1b117
to
14c5156
Compare
14c5156
to
650da73
Compare
Sounds good to me @Uzaaft ! Just updated the commit I made to move it to |
650da73
to
d9314f9
Compare
@Uzaaft should be fixed now |
Thank you! Apologies for the delay, was tied up with work when I saw your updates. This implementation is actually something I was trying to figure out how to build--a config with a nice default that could be overwritten by the user--buy was struggling with implementation. I may take a pass at updating the defaults to match the colorscheme I built, as they were intentionally set that way for usability, but I think this overall approach makes much more sense for extendability. I can look into hosting the image from my fork as a remote URL if that would be preferred so that it doesn't need to live in this git repo history as well. Thank you again for the feedback and update on my code! |
Yeah I think the main thing is trying to make the pack usable by the masses. So integrating it in a way that supports most colorschemes is much more sensible as a default than something that supports one colorscheme. And then something specific enough for your setup should go in your user configuration |
I can also help you migrate your code to the override code for this pack that you can include in your user configuration. It's very simple to achieve the final product you had originally from the current code I uploaded and overriding things in your user configuration |
Happy to ultimately defer to this suggestion--but just to make my point--my goal was recreating this old VSCode addon where the bracket-pair and scope had different effects to highlight the scope you were focused in alongside your color-coded bracket pairs, which is why I built a separate theme and character type for the highlights vs the scope ibl line. If this is how ultimately how you'd prefer it to be, no worries, just explaining why my initial effort was so "opinionated" |
d9314f9
to
6b5ce64
Compare
I did go ahead and add the show start and end back to my code to get that top line for example |
With the tighter integration with rainbow delimiters, to recreate your original code after you import this pack you can simply put this in your return {
{
"HiPhish/rainbow-delimiters.nvim",
opts = {
highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
},
},
},
{
"lukas-reineke/indent-blankline.nvim",
opts = {
scope = { char = "▏", show_start = true, show_end = true },
indent = {
char = "╎",
highlight = {
"RainbowRedIndent",
"RainbowYellowIndent",
"RainbowBlueIndent",
"RainbowOrangeIndent",
"RainbowGreenIndent",
"RainbowVioletIndent",
"RainbowCyanIndent",
},
},
},
},
} This assumes you have correctly set up the highlight groups, you can also extend AstroUI to more safely add in those highlight groups only if they don't exist in the colorscheme that is being loaded for example: return {
{
"AstroNvim/astroui",
---@param opts AstroUIOpts
opts = function(_, opts)
if not opts.highlights then opts.highlights = {} end
local init_highlights = opts.highlights.init or {}
opts.highlights.init = function(colorscheme)
if type(init_highlights) == "function" then init_highlights = init_highlights(colorscheme) end
for hlgroup, fallback in pairs {
RainbowRed = { fg = "#E06C75" },
RainbowYellow = { fg = "#E5C07B" },
RainbowBlue = { fg = "#61AFEF" },
RainbowOrange = { fg = "#D19A66" },
RainbowGreen = { fg = "#98C379" },
RainbowViolet = { fg = "#C678DD" },
RainbowCyan = { fg = "#56B6C2" },
RainbowRedIndent = { fg = "#6e171e" },
RainbowYellowIndent = { fg = "#765517" },
RainbowBlueIndent = { fg = "#0c497a" },
RainbowOrangeIndent = { fg = "#603d1d" },
RainbowGreenIndent = { fg = "#3b5727" },
RainbowVioletIndent = { fg = "#5a1b6d" },
RainbowCyanIndent = { fg = "#1e4c52" },
} do
if vim.fn.hlexists(hlgroup) ~= 1 then init_highlights[hlgroup] = fallback end
end
return init_highlights
end
end,
},
{
"HiPhish/rainbow-delimiters.nvim",
opts = {
highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
},
},
},
{
"lukas-reineke/indent-blankline.nvim",
opts = {
scope = { char = "▏", show_start = true, show_end = true },
indent = {
char = "╎",
highlight = {
"RainbowRedIndent",
"RainbowYellowIndent",
"RainbowBlueIndent",
"RainbowOrangeIndent",
"RainbowGreenIndent",
"RainbowVioletIndent",
"RainbowCyanIndent",
},
},
},
},
} This would get you what you originally shared which had those extra dashed indent lines and uses your own custom highlight groups that wouldn't necessarily be supported by any other colorscheme: |
Let me know what you think @ammuench , my main point being I think the code that I pushed perfectly emulates the original Bracket Pair Colorizer 2 addon like you are looking for. Not sure if you tried it and didn't agree |
This looks good to me! Appreciate the extra time with examples, it all finally clicked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
📑 Description
Adds a plugin to create a mock of the old VSCode
bracket-pair-colorizer
based on a custom config forindent-blankline
andrainbow-delimiters
plus some custom color mappings & vim mappings built by myself.Creates a "dashed" colorized line for bracket/indent pairs within AstroNvim and highlights the corresponding bracket/XMLtag to make the scope clear.
Shows the active scope based on your treesitter language pack, can be disabled/toggled by user request. Mapping to toggle the indent highlighting in general also provided
ℹ Additional Information
Users can turn scope highlight off with command in
README.md
.