ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

Recognise variable references in *.vim themes #161

Closed savchenko closed 2 years ago

savchenko commented 2 years ago

Hopefully this is "easier" to implement for .vim rather than for other formats. On the screenshot below hex colours are rendered as expected, however the g:terminal_color_background isn't highlighted:

image

This would be quite useful when editing theme files so that one can see colours "live" instead of bare variables:

image

ap commented 2 years ago

Hopefully this is "easier" to implement for .vim rather than for other formats.

Why do you think it would be? Vim doesn’t provide an API to access its Vim Script parser from scripts. The only difference I can think of between other formats and Vim Script is that the plugin could eval()/:execute (bits of) the file. And that’s… not what you’d want. Am I missing anything?

savchenko commented 2 years ago

Vim doesn’t provide an API to access its Vim Script parser from scripts

Did not know this. Please don't eval() unknown code for the obvious reasons. Closing the ticket.