0

I am trying to switch to vim for all my editing and trying out the plugins. I have been using snipmate and ragtag and like them both. Now I am coding PHP with HTML in it and I saw this question to get snipmate to work with snippets for the two file types here: Vim - Activiting HTML snippets on PHP files .

This works well, I can get snippets for both PHP and HTML, but ragtag is no longer introducing PHP <?php ... ?> blocks, it's introducing <% ... %>. Is there a way to fix this?

Thank you.

4

1 回答 1

0

It's possible that Ragtag doesn't understand multiple filetypes. Does it work when you :set ft=php or :set ft=html.php ?

I've never used ragtag, but since you are using Snipmate too why don't you just type php<Tab>?

It's certainly a lot easier to remember and more "mnemonic" than <C-X>_ (if I read the doc well).

-- EDIT --

It appears a check is made on ft (filetype) at line 71 but it accepts only "php" as value, since you have set ft=php.html ragtag should accept "php.html" as well.

I think changing this line from

if &ft == "php"

to

if &ft == "php" || &ft == "php.html"

should work.

于 2011-09-12T05:36:17.167 回答