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.

Community
  • 1
  • 1
ravl1084
  • 291
  • 4
  • 11

1 Answers1

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.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • Thank you very much! This works quite well. The reason I'm not using snipmate for the php tag is that i'm using a lot of inline `` statements and the snipmate makes multiline indented tags. – ravl1084 Sep 12 '11 at 14:58
  • You could add a custom "`ph`" snippet that expands to ``. – romainl Sep 12 '11 at 15:44