Return to Snippet

Revision: 32584
at September 29, 2010 11:03 by studiomohawk


Initial Code
au BufRead,BufNewFile *.php set filetype=php.html

Initial URL
http://dancingpenguinsoflight.com/2009/07/light-at-the-end-of-the-carpal-tunnel-snippets-in-vim-with-snipmate/

Initial Description
One issue I ran into early on was wanting more than one filetype’s snippets available for a single file. In my case, I was editing a file with a .php extension, but it had a lot of HTML in it as well. Since the filetype is determined from the extension, I only had the snippets for PHP. To fix this, I added a file ~/.vim/ftdetect/php.vim, containing:\\r\\n\\r\\nWhen a file with an extension matching a filename in ftdetect is opened, its filetype can be changed to whatever is desired via a directive like the one above. The dot separating the filetypes allows for multiple formats to be made available at once.

Initial Title
Multiple filetype for snipmate.vim

Initial Tags


Initial Language
Other