Can I use YaSnippet, nXhtml, MuMaMo and TabKey2 together?

Created by lborgman on on 2010-04-25
Keywords:
yasnippet mumamo tabkey2
Last updated by:
lborgman on on 2010-04-25

If you are using YaSnippetMode you can use the snippets for html-mode in nxhtml-mode. To do that just add this to your .emacs:

    (yas/define-snippets 'nxhtml-mode nil 'html-mode)

This works also in multi major mode buffers where you can use the snippets for the major mode in the chunk.

And it also works with [TabCompletion TabKey2] (which comes with nXhtml). If you hit TAB then yasnippet gets the chance to expand first
(because it is by default first in tabkey2 list of completion functions). If it doesn't then the other completion functions get their chances.

So for example if you in a nxhtml-mode chunk have written /h1/ and press TAB then yasnippet will expand it. If yasnippet does not expand the word before point then nxhtml-mode completion gets the chance next, etc.

BTW, there are snippets for PHP and dojo (a javascript framework) in the http://www.emacswiki/emacs/YaSnippetMode user contributed snippets repository.