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

前端 未结 7 1026
灰色年华
灰色年华 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:31

    Snippets are stored in directory called snippets somewhere in your ~/.vim folder.

    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.

    Eventually you could copy the content of ruby.snippets and html.snippets into your new 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.

提交回复
热议问题