External syntax highlithing

Has anybody tried to do external syntax highlighting?

I would like to build a plugin that uses scintillua for syntax highlighting. However it would be nice to have a starting point. Does anybody know a plugin that does something similar? (Maybe based on tree-sitter)

I’m especially interested in the following questions:

  • How to disable/override the normal regex syntax highlighter for a specific filetype?
  • How to update syntax highlighting in a buffer and which hook is the best to use?

Thanks in advance for any hints

  • How to disable/override the normal regex syntax highlighter for a specific filetype?

set-option global disabled_hooks "%opt{disabled_hooks}|rust-highlight"

There is a tree-sitter plugin but no syntax highlighting yet, see Syntax highlighting · Issue #8 · ul/kak-tree · GitHub

kak-lsp implements LSP semantic tokens which you can use as inspiration. At least rust-analyzer supports those.

1 Like