Categories
Digital rights Law & Freedom Emacs GNU/Linux Free Software & Open Source News Programming & Web Development

Make Emacs yasnippet work with html-helper-mode

code
Yasnippet is a great emacs minor mode that lets you have lots of code snippets easily at hand. Also you can create your own snippets in a very easy way without needing to write them in emacs lisp. Basically, like textmate shortcuts for emacs.

I use html-helper-mode to edit all my html code, but yasnippet works with html-mode only out-of-the-box. To make it work with html-helper-mode, add ‘html-helper-mode-hook’ to yasnippet.el on line 121:

It should look like this:

'(ruby-mode-hook actionscript-mode-hook ox-mode-hook python-mode-hook html-helper-mode-hook))

Then make a symlink to html-mode on the snippets folder. Assuming you are on yasnippets snippets/text-mode/ directory, type:


ln -s html-mode/ html-helper-mode

And now all html snippets will be available on html-helper-mode too.

Image is Creative Commons byitspaulkelly

By Gabriel Saldaña

Gabriel Saldaña is a web developer, photographer and free software advocate. Connect with him on and Twitter

2 replies on “Make Emacs yasnippet work with html-helper-mode”

Christos Trochalakis,

well, its not really a patch, its more like a hack or workaround. I don’t think it will be accepted since it needs a symlink. I’ll take a deeper look at the code to see if I can come up with a real patch.

Comments are closed.