-
I have scripts written in various languages. They start with a shebang line and usually the rest is code in the chosen language. When I open a file named 'mycoolscript' in helix, helix doesn't know what language the file is in. It would be nice if there was some way to annotate the file to let helix know what language it's in. For example, in vim I can add a line like this: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
helix already supports filetye selections using shebangs. Your language is likely just not commonly used with a shebang so the detection fails |
Beta Was this translation helpful? Give feedback.
-
Ah! Thanks for the clue! While it's not the same mechanism and I was thinking about, at least for Haskell I can just add a ~/.config/helix/languages.toml with:
And my scripts now load into helix with the correct 'haskell' filetype. The default languages.toml does not have a shebang line for Haskell, so it doesn't work by default, like you said. |
Beta Was this translation helpful? Give feedback.
Ah! Thanks for the clue! While it's not the same mechanism and I was thinking about, at least for Haskell I can just add a ~/.config/helix/languages.toml with:
And my scripts now load into helix with the correct 'haskell' filetype. The default languages.toml does not have a shebang line for Haskell, so it doesn't work by default, like you said.