This is a re-implementation of semantic-highlight.vim in lua targeting neovim, using tree-sitter instead of the hardcoded list. And most important of all randomly generated colors with much bigger color space, never will symbols collide with the same colors.
Every identifier is a different color, an idea popularized by Evan Brooks' blog post.
With Lazy, currently setup function only accept list of file types to enable plugin for.
{
'hantianjz/semhl.nvim',
opts = {
filetypes = { "c", "cpp", "h", "python", "lua", "typescript", "java" },
max_file_size = 100 * 1024
}
}
- Support custom tree-sitter query
- Clean up the way plugin is loaded and unloaded
- Allow changing highlight priority
- High color generation configurable
- Generate colors based on background colors
- Check for color collision with highlight next that is close in edit distance