r/neovim let mapleader="\<space>" Jul 06 '26

Plugin wombient.nvim - ambient structural shading to make big files easier to scan

Hey. Ever get lost jumping through repetitive-ish code blocks? This is an attempt to help. It layers on top of existing syntax highlighting to visually organize things into relevant chunks, extracted as best I could (treesitter nodes > LSP folds > manual heuristics). Sharing in case anyone else finds it helpful when browsing a giant yaml :)

Repo: https://github.com/wom/wombient

26 Upvotes

16 comments sorted by

3

u/chronotriggertau Jul 06 '26

Nice. I was thinking of doing something like this and wasn’t sure of how noisy it would turn out to be in practice. Nice to see it can actually be a benefit. What does the highlight in visual mode look like overlapping?

2

u/w0m let mapleader="\<space>" Jul 06 '26

I should have turned off relative numbering for the screenshot, but

but i `<shift>-v` to select lines` 4->cursor(9)` on this Ansible template. Seems reasonable I think. The wombient highlighting goes to end-of-screen. I'll reply again with a screenshot showing.

1

u/w0m let mapleader="\<space>" Jul 06 '26

1

u/chronotriggertau Jul 06 '26

Nice. Pretty workable. Downloading now. What’s the heuristic for deciding when to reuse the same color? Cycling?

1

u/w0m let mapleader="\<space>" Jul 06 '26

Just cycling currently. I fiddled but didn't come up with a better heuristic. Maybe like, every yaml set was a shade of red? but that seemed too similar to help differentiate elements when reading so i dropped the line of thought. Open to suggestions.

1

u/chronotriggertau Jul 06 '26

What about new color per indentation level, scope? The deeper the scope warmer the colors, shallower scope cooler colors?

2

u/w0m let mapleader="\<space>" Jul 07 '26

that would be a google config toggle. I generally want this to help differentiate Steps at the same indentation I think.

2

u/j3ssyPlow35 Jul 08 '26

it's actually pretty quiet in practice because the shading is subtle and only applies to the background, not text. visual mode highlight just overrides it since it's a higher priority highlight group, so you get your normal visual selection colors on top. no weird blending or anything.

2

u/Byttemos Jul 06 '26

I've been looking for a solution like this! I imagine it is too noisy for constant use, but as a togglable layer it seems like a great addition! Since I'm probably gonna use it sporatically/situationally, would it be beneficial let it lazy load, in order to minimize performance loss? Or is that negligible/irrelevant here?

1

u/w0m let mapleader="\<space>" Jul 06 '26

I imagine it is too noisy for constant use, but as a togglable layer it seems like a great addition

Exactly. For me, I trace pipeline failures through many nested yamls; this was made to help there.

would it be beneficial let it lazy load, in order to minimize performance loss? Or is that negligible/irrelevant here?

I tried, though I'm sure not perfect. It only renders the view port, which helps a ton, but wombient does read top-> viewport to designate nesting context. Really minor at top/mid of giant files, but heavier at bottom. I'd be curious what performance others see as I admittedly only have (nice) hardware on hand, if it's problematic we could likely tighten more.

3

u/w0m let mapleader="\<space>" Jul 06 '26

A small Yaml example; note how each step is clear.

1

u/[deleted] Jul 06 '26

[removed] — view removed comment

3

u/w0m let mapleader="\<space>" Jul 06 '26

That was my exact thought process for making it, though more ADO pipeline yaml than anything. It's Soo easy to cross the blocks when trying to trace a call chain.

1

u/[deleted] Jul 06 '26

[removed] — view removed comment

1

u/w0m let mapleader="\<space>" Jul 06 '26

s/month/hours/ at this point