Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use yasnippets of other mode in web mode

I would like to make the snippets in js-mode available in web-mode.

There is no too many snippets in web-mode. What should I do to use javascript or HTML snippets in web-mode?

like image 406
ppn029012 Avatar asked Oct 18 '22 22:10

ppn029012


1 Answers

Inside the snippets folder of web-mode, you can create a file called .yas-parents and just put the modes you want to include into web-mode, in your case, js-mode.

Several other modes use the same structure, for instance, most programming language modes have the prog-mode as parent (which contains generic stuff programmers use such as TODOs)

like image 154
Henrique Jung Avatar answered Oct 24 '22 16:10

Henrique Jung