ppn029012
ppn029012

Reputation: 570

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?

Upvotes: 5

Views: 698

Answers (1)

Henrique Jung
Henrique Jung

Reputation: 1498

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)

Upvotes: 3

Related Questions