3 ms·
Perhaps this: Semantic Highlighting in Neovim https://gist.github.com/swarn/fb37d9eefe1bc616c2a7e476c0bc0316 https://gist.github.com/swarn/fb37d9eefe1bc616c2a7
by card_zero 2y ago
Perhaps this: Semantic Highlighting in Neovim
https://gist.github.com/swarn/fb37d9eefe1bc616c2a7e476c0bc0316 https://gist.github.com/swarn/fb37d9eefe1bc616c2a7e476c0bc03...
In the comments there's also a link to a plugin that does a different kind "Where every variable is a different color":
https://github.com/jaxbot/semantic-highlight.vim https://github.com/jaxbot/semantic-highlight.vim
- teo_zero 2y agoAs you pointed out, the latter does a very different kind of highlighting. The former is truly semantic, but needs an external compiler (via LSP).
- wruza 2y agoI wouldn’t expect someone to replicate a full compiler as an internal editor plugin ever again only to highlight mistakes. Language servers and their support is one of the best things that happened to editors recently. Everyone moved on from ad-hoc plugins. LSP is what you’re looking for, imo. A regular LSP for semantic errors and a linter LSP[-like] for style, bad practice, unused entity, deprecation, etc warnings. For requirement 2 and 3 I think VSCode can do that. Some themes tint every possible class of token, so casting will look different from multiplication. Afaik, it definitely differentiates functions, locals, globals and members, while they are all identifiers.