Vim html.erb snippets?? snipMate Need a vim tip

前端 未结 7 1028
灰色年华
灰色年华 2021-02-04 08:47

When I\'m in an html.erb file, I get no snipMate snippets.

I would like both HTML and Ruby, or just HTML would be fine, How would I do this?

Would I need to writ

相关标签:
7条回答
  • 2021-02-04 09:38

    I used the autocommand method to the set the filetype, but then I got html syntax errors for things like this:

    <%= image_tag("logo.png", :alt => "Sample App", :class => "round") %>
    

    The last two angle brackets would be highlighted in red, which drove me bonkers. So, I created a symlink called eruby.snippets that points to html.snippets. That worked like a champ and now I don't have to make changes in two places. I also have an eruby-rails snippet directory for non-html eruby snippets.

    This is on a Mac OS X system. Note that an alias won't work. You need to hit the terminal and use the ln command. Not sure about doing this on a Windoze system.

    0 讨论(0)
提交回复
热议问题