Skip to content

Remove default syntax highlighting #161

Answered by ubolonton
mikelu92 asked this question in Q&A
Discussion options

You must be logged in to vote

We don't have a mechanism to selectively remove a specific highlighting pattern yet.

There are 2 things you can do at the moment:

  1. Copy the query pattern file returned by (tree-sitter-langs--hl-query-path 'go). Modify it to suit your need. Then advise the function tree-sitter-langs--hl-query-path to return that file instead. For example:
(define-advice tree-sitter-langs--hl-query-path (:before-until (lang-symbol) override-default-patterns)
  (pcase lang-symbol
    ('go "/path/to/your/modified/highlights.scm")))

Not highlighting all identifiers as @variable is actually consistent with tree-sitter-langs's styles. The Go patterns should be modified to do so. A pull request is welcome.

  1. Add …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mikelu92
Comment options

@mikelu92
Comment options

Answer selected by ubolonton
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Not a bug report or feature request
2 participants
Converted from issue

This discussion was converted from issue #155 on August 01, 2021 11:38.