问题描述
当我使用html.erb文件时,没有任何snipMate片段。
When I'm in an html.erb file, I get no snipMate snippets.
我想要HTML和Ruby,或者只用HTML就可以了,
我该怎么做?
I would like both HTML and Ruby, or just HTML would be fine,How would I do this?
我需要写一些代码段吗?
Would I need to write a set of snippets?
如果是这样,是否有办法在不复制现有摘要的情况下提取它们?
If so, is there a way of pulling in existing snippets without copying them?
有没有办法告诉vim当看到.html erb时进入html模式?
Is there a way of telling vim to go into html mode when it sees .html erb?
推荐答案
片段存储在片段
目录中,位于您的〜/ .vim
文件夹。
Snippets are stored in directory called snippets
somewhere in your ~/.vim
folder.
如果在该目录中查找,通常每种文件类型只有一个文件,而c。代码段,一个ruby.snippets,所以看来您要做的就是在其中创建一个erb.snippets。
If you look there, there is usually one file per filetype, there is a c.snippets, a ruby.snippets, so it seems what you have to do is to create an erb.snippets there with what you want.
最终,您可以复制其中的内容在新的erb.snippets中添加ruby.snippets和html.snippets。
Eventually you could copy the content of ruby.snippets and html.snippets into your new erb.snippets.
或者您可以在github上搜索,有些人已经发布了自己的erb.snippets配置信息。例如,那里有一个不错的收藏:
Alternatively you can search on github, some people have posted their own erb.snippets configuration. For example, there is a nice collection there :https://github.com/scrooloose/snipmate-snippets
最好先尝试打开一个代码段文件并查看其语法,根据您的需要创建自己的代码段非常容易您最常使用的东西。
The best thing would to try first to open a snippet file and look at the syntax, it is pretty easy to create your own snippet depending on what you use the most.
这篇关于Vim html.erb代码片段? snipMate需要vim提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!