0

I have latest YASnippet package installed on GNU Emacs 27.2 via MELPA. Snippets work, for example in *.js files, let expands to snippet after hitting TAB. However, when I edit HTML file (in html-mode), the JS inside <script> tag does not use YAS. Also, CSS snippets don't work in <style>.

I tried web-mode, but it fixes only JS.

Are there other solutions?

Vlad Havriuk
  • 111
  • 4
  • 1
    I did not further look into it, but [this](https://emacs.stackexchange.com/questions/10960/one-yasnippet-snippet-for-multiple-modes) general answer might help you on your way. – dalanicolai Aug 24 '21 at 11:56
  • @dalanicolai Thank you, it seems to solve the problem – Vlad Havriuk Aug 24 '21 at 12:00

1 Answers1

1

The answer mentioned by @dalanicolai helped a lot: I just had to edit ~/.emacs.d/snippets/html-mode/.yas-parents to contain css-mode js-mode.

Vlad Havriuk
  • 111
  • 4