Short of some creative extra rules in your color scheme and a plugin of some kind, I don’t think this is possible to do.
The color that is applied by the color scheme is based on the scope
of the text as defined in the syntax definition. However for hashed colors the color chosen is based on a hash of the text that contains that scope.
So in your example, :Match0:
would always appear as the same color, but there’s no way to signal that color should also be applied to the remainder of the line except by including it in the scope
(by modifying the syntax). In that case the two :Match0:
lines would have the same scope but different text, so they’d hash differently and thus have different colors.
In theory you could add rules to your color scheme that have all of the colors you’d want to use for this, including background colors, and then use a plugin to add regions to the text to colorize it. Such a plugin would have to trigger at on_load
to handle files you’ve just opened and on_modified
or on_modified_async
to re-apply the changes whenever the file is modified in any way.
You’d also have to implement the hashing yourself to determine what ultimate color to use.