Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helix highlight queries #16

Open
gerblesh opened this issue Jan 3, 2025 · 1 comment
Open

Helix highlight queries #16

gerblesh opened this issue Jan 3, 2025 · 1 comment

Comments

@gerblesh
Copy link
Contributor

gerblesh commented Jan 3, 2025

Not sure if it should live in this repository, but I've modified the highlight queries to work with Helix. The problem is that nvim and helix highlight queries are different enough to where this can't just be merged into the highlights.scm as it would subsequently break highlighting in neovim. I'm leaning towards upstreaming these into helix itself once this grammar is stable rather than having the queries as a separate file inside this repo.

; extends
; Comments
(comment) @comment

; Keys
(property) @variable

; Values
(boolean) @constant.builtin.boolean


[
 (number)
 (adjustment)
] @constant.numeric

[
 "+"
 "="
 (keybind_trigger ">")
] @operator

(":") @punctuation.delimiter

; (color) are hex values
(color "#" @punctuation.special
 (#eq? @punctuation.special "#"))

(path_value "?" @keyword.control.conditional
    (#eq? @keyword.control.conditional "?"))

; `palette`
(palette_index) @variable.member

; `config-file`
(config_file_directive (property) @keyword.import)
(config_file_directive (path_value) @string.special.path)


(action_name) @function.builtin
(action_argument (string) @variable.parameter ) 

[
 (string)
 (color)
] @string

; clear is a special keyword that clear all existing keybind up to that point
((keybind_value) @keyword 
 (#eq? @keyword "clear"))

; `keybind`
(keybind_value) @string.special

; NOTE: The order here matters!
[
 (key_qualifier)
 (keybind_modifier)
] @attribute

[
 (modifier_key)
 (key)
] @constant.builtin

screenshot:
image

@gerblesh gerblesh changed the title Helix highlight groups/queries Helix highlight queries Jan 3, 2025
@bezhermoso
Copy link
Owner

Yeah, the order of precedence between the two would necessitate having separate ones. I wouldn't be against bundling a Helix-optimized highlights.scm file if it makes it easier for the purpose of having something to test with as we work on the grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants