Add instructions for Helix Editor.
aspizu opened this issue ยท 6 comments
Add instructions for Helix Editor
- One can add this to their
languages.toml
[[language]]
name= "hypr"
scope= "source.conf"
file-types= [ "conf"]
roots= [ "hyprland.conf"]
comment-token= "#"
grammar= "hypr"
[[grammar]]
name= "hypr"
source= { git= "https://github.com/luckasRanarison/tree-sitter-hypr", rev= "master"}
- then run
hx -g fetch
hx -g build
- then create the directory "{ your helix runtime directory}/queries/hypr" and put:
{ highlights.scm, indents.scm}
within this directory - for textobject-s to work, one must write a
textobjects.scm
file
Note
- This will currently match all file-s matching *.conf
I do not know how to change this, I believe this may be an issue resolved by this merge request - After running
hx -g fetch
, one can find this project~s source code in { your helix runtime directory}/grammars/sources/hypr
Warning
- A note on the helix documentation: Helix parses query-s in the reverse direction to neovim. If this becomes an issue then one must clone this repository and rearrange the query-s for self hosting or as a fork of this repo.
@lucyColeclough Thanks for the detailed explanations, I hadn't the time to try helix yet. The highlights queries don't overlap so I think it should also work in Helix.
neovim and helix queriers are not at all identical so you need to create queries for helix if you want to use it with this grammar. We use different capture names and different query precedence
- One can add this to their
languages.toml
[[language]] name= "hypr" scope= "source.conf" file-types= [ "conf"] roots= [ "hyprland.conf"] comment-token= "#" grammar= "hypr" [[grammar]] name= "hypr" source= { git= "https://github.com/luckasRanarison/tree-sitter-hypr", rev= "master"}* then run
hx -g fetch hx -g build* then create the directory "{ your helix runtime directory}/queries/hypr" and put: `{ highlights.scm, indents.scm}` within this directory * for textobject-s to work, one must write a `textobjects.scm` file
Note
* This will currently match all file-s matching *.conf I do not know how to change this, I believe this may be an issue resolved by [this merge request](https://github.com/helix-editor/helix/pull/8006) * After running `hx -g fetch`, one can find this project~s source code in { your helix runtime directory}/grammars/sources/hypr
Warning
* A note on [the helix documentation](https://docs.helix-editor.com/guides/adding_languages): Helix parses query-s in the reverse direction to neovim. If this becomes an issue then one must clone this repository and rearrange the query-s for self hosting or as a fork of this repo.
@lucyColeclough It looks as though that PR is still open to prevent this hypr config from taking the parsing of all *.conf files -- are you able to shed any light on when/if that PR is likely to be resolved?
Update: The queries in this repo now use Helix capture names so it can also be used in Helix, and as I said there are no overlapping queries so there should not be priority problems.
are you able to shed any light on when/if that PR is likely to be resolved?
It appears there was recent work on this, I do not work on it