vim - 一起使用 snipmate 和 ragtag
我正在尝试切换到 vim 进行所有编辑并尝试插件。我一直在使用 snipmate 和 ragtag,并且都很喜欢它们。现在我正在用 HTML 编写 PHP 代码,我看到这个问题让 snipmate 能够在此处处理两种文件类型的片段: Vim - 激活 PHP 文件上的 HTML 片段 .
这很有效,我可以获取 PHP 和 HTML 的片段,但是 ragtag 不再引入 PHP 块,而是引入
<% .. %>。有办法解决这个问题吗?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ragtag 可能不理解多种文件类型。当您
:set ft=php
或:set ft=html.php
时它起作用吗?我从未使用过 ragtag,但既然你也使用 Snipmate,为什么不直接输入
php
呢?它肯定比
_
更容易记住并且更“助记”(如果我很好地阅读了文档)。-- 编辑 --
似乎对
ft
(文件类型)进行了检查 在第 71 行,但它只接受"php"
作为值,因为你已经set ft= php.html
ragtag 也应该接受"php.html"
。我认为将这条线从
改为
应该可行。
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 haveset ft=php.html
ragtag should accept"php.html"
as well.I think changing this line from
to
should work.