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

Make a Helix PR to add the Vim language server and grammar #86

Open
llakala opened this issue Nov 13, 2024 · 3 comments
Open

Make a Helix PR to add the Vim language server and grammar #86

llakala opened this issue Nov 13, 2024 · 3 comments

Comments

@llakala
Copy link
Owner

llakala commented Nov 13, 2024

I've been setting up custom Vim binds for Obsidian recently. It's not really suitable to here, since Obsidian isn't one for declarativeness. I'm using an Obsidian plugin that lets me add a custom vimrc to Obsidian, and I've been setting up lots of Helix binds to match my preferences.

However, Helix doesn't understand how to highlight the file, because it doesn't include the tree-sitter for vim files.

If all was right in the world, I could just pass in the custom grammar to the programs.helix module, linking directly to the existing tree-sitter grammar. That's done perfectly here.But woe, all is not so simple

Instead, I think PRing the Vim grammar into https://github.com/helix-editor/helix/blob/master/languages.toml is best. It seems relatively simple to include, and will allow other people to be free of issues when it comes to this.

While I definitely want to make that PR, I also want to try out the solution seen here, where they worked around Helix being unable to support custom grammars by just placing it in with xdg.configFile directly. Seems fun and cool, and if it works, I could share this as a solution on the home-manager issue.

@llakala
Copy link
Owner Author

llakala commented Nov 13, 2024

I was able to get the language server working by tweaking the filetypes, but no luck on grammars yet. Here's another config to reference:
https://github.com/cowboyliao/myflake/blob/e8d4eb0481d26e6d9f41ade9878f3582f17a25da/home-manager/modules/helix.nix#L14

@llakala llakala changed the title Make a Helix PR to add the Vim language server Make a Helix PR to add the Vim language server and grammar Nov 13, 2024
@llakala llakala reopened this Nov 13, 2024
llakala added a commit that referenced this issue Nov 13, 2024
Closes #86
We have the language server working, but no luck yet on the grammar.
May require PRing into Helix to add it, but it'd be difficult to get
working if I can't have it working on my machine.
@llakala
Copy link
Owner Author

llakala commented Nov 13, 2024

Ignore all the spam above.

@llakala
Copy link
Owner Author

llakala commented Nov 15, 2024

I put the language server stuff on main, since it was stable enough and got what I needed working. I had no luck with following what other people did to get the grammar working. Needs further investigation.

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

Successfully merging a pull request may close this issue.

1 participant