I want to enable html snippets for php files. The Ultisnips manual said what I need to do is put extends html
command at the beginning of the php.snippets
file. But it doesn't work. HTML snippets still aren't showing up. How do I extend it properly?
2 Answers
It's difficult to point out where your problem is, since you didn't really describe what exactly you did; but this is how I added a custom PHP snippet file:
I installed http://github.com/SirVer/ultisnips and http://github.com/honza/vim-snippets
I created
~/.vim/UltiSnips/php.snippets
with the contents:extends php, html snippet 42 The universe, life, and everything endsnippet
After opening a new Vim, I can use
42<Tab>
, and the standard PHP snippets (eg.if<Tab>
), and HTML snippets (eg.div<Tab>
).
See :help UltiSnips-adding-snippets
for more information.
You did the opposite. You should have written extends php
in your html.snippets
file. Then you can open a myfile.php and start using html snippets.