llakala / nixos

My NixOS config
GNU General Public License v3.0
6 stars 1 forks source link

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

Open llakala opened 1 day ago

llakala commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

Ignore all the spam above.