Skip to content

Semantic Highlighting for neo vim in lua

Notifications You must be signed in to change notification settings

hantianjz/semhl.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

semhl.nvim

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.

image

setup

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
  }
}

TODO

  • 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

About

Semantic Highlighting for neo vim in lua

Resources

Stars

Watchers

Forks

Languages