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

colors in i18n block #15

Open
suruaku opened this issue Oct 20, 2021 · 1 comment
Open

colors in i18n block #15

suruaku opened this issue Oct 20, 2021 · 1 comment

Comments

@suruaku
Copy link

suruaku commented Oct 20, 2021

I have <i18n lang="yaml"> block in vue files, which doesn't have any colors. Is it possible to get them using this plugin? If not does anyone know how to achieve that?
image

@suruaku suruaku changed the title i18n colors colors in i18n block Oct 20, 2021
@captainko
Copy link

@suruaku try these

;; filename: after/queries/vue/injections.scm

(element
  (start_tag
    ((attribute
      (attribute_name) @_attribute_name
      (quoted_attribute_value
        (attribute_value) @_attribute_value))))
  (text) @yaml
  (#eq? @_attribute_name "lang")
  (#match? @_attribute_value "(yaml|yml)"))


;; Bonus for json highlighting
(element
  (start_tag
    ((attribute
      (attribute_name) @_attribute_name
      (quoted_attribute_value
        (attribute_value) @_attribute_value))))
  (text) @json
  (#eq? @_attribute_name "lang")
  (#match? @_attribute_value "json"))

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

No branches or pull requests

2 participants