Skip to content

Conversation

@santiagorodriguez96
Copy link
Collaborator

@santiagorodriguez96 santiagorodriguez96 commented Dec 22, 2025

There's an issue with yml files as vim-rails is changing its file types to eruby.yaml(https://github.com/tpope/vim-rails/blob/b0a5c76f86ea214ade36ab0b811e730c3f0add67/plugin/rails.vim#L111-L114) so treesitter-yaml is not picking them as yaml files and thus the files don't get syntax highlight'ed.

We could simply register the yaml language for the eruby.yaml filetype in treesitter, but the syntax highlighting from treesitter doesn't takes the embedded ruby into account (it just considers them as strings), so this commits goes a step forward and disables syntax highlighting for treesitter-yaml.

(Note that we are still linking treesitter-yaml to the eruby.yaml so that it considers them yaml files and thus not highlights them, allowing vim-ruby syntax highlighting instead)

There's an issue with `yml` files as `vim-rails` is changing its file
types to `eruby.yaml`(https://github.com/tpope/vim-rails/blob/b0a5c76f86ea214ade36ab0b811e730c3f0add67/plugin/rails.vim#L111-L114)
so `treesitter-yaml` is not picking them as `yaml` files and thus its
syntax highlighting is not enabled.

We could simply register the `yaml` language for the `eruby.yaml`
filetype  in treesitter, but the syntax highlighting from treesitter
doesn't takes the embedded ruby into account (it just considers them as
strings), so this commits goes a step forward and disables syntax
highlighting for `treesitter-yaml`.

(Note that we are still linking `treesitter-yaml` to the `eruby.yaml` so
that it considers them `yaml` files and thus not highlights them,
allowing `vim-rails` syntax highlighting instead)
@santiagorodriguez96 santiagorodriguez96 changed the title Use vim-rails syntax highlighting for yaml files Use vim-ruby syntax highlighting for yaml files Dec 22, 2025
@santiagorodriguez96 santiagorodriguez96 changed the title Use vim-ruby syntax highlighting for yaml files Use vim-ruby syntax highlighting for yaml files in Rails applications Dec 22, 2025
@santiagorodriguez96 santiagorodriguez96 changed the title Use vim-ruby syntax highlighting for yaml files in Rails applications Use vim-ruby syntax highlighting for yml files in Rails applications Dec 22, 2025
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 this pull request may close these issues.

2 participants