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

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

    You can use an autocmd to set the filetype to html when opening a ".html.erb" file. This could have unwanted side effects for plugins that work for ".erb" files.

    autocmd BufNewFile,BufRead *.html.erb set filetype=html
    

    You can also load more than one set of snippets by using a dotted filetype:

    autocmd BufNewFile,BufRead *.html.erb set filetype=html.eruby
    

    See :help snippet-syntax in the snipMate help for more info.

提交回复
热议问题