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

Add instructions for Helix Editor. #1

Open
aspizu opened this issue Aug 24, 2023 · 6 comments
Open

Add instructions for Helix Editor. #1

aspizu opened this issue Aug 24, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@aspizu
Copy link

aspizu commented Aug 24, 2023

Add instructions for Helix Editor

@lucyColeclough
Copy link

lucyColeclough commented Aug 26, 2023

  • 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.

@luckasRanarison
Copy link
Collaborator

@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.

@luckasRanarison luckasRanarison added the enhancement New feature or request label Aug 27, 2023
@pascalkuthe
Copy link

pascalkuthe commented Aug 27, 2023

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

@alphastrata
Copy link

  • 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?

@luckasRanarison
Copy link
Collaborator

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.

@lucyColeclough
Copy link

lucyColeclough commented Feb 11, 2024

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

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

No branches or pull requests

5 participants