Search code examples
vimsnipmate

How to add another file extension (e.g. 'style.less') to Vim's snipMate plugin?


I would like to write snippets for Less (.less) and Stylus (.styl) and use then in Vim's snipMate plugin. How can I accomplish that?

EDIT: I know that the first step is to create a file inside the snippets folder with a name like this: less.snippets or stylus.snippets but after that I'm not sure what to do.


Solution

  • Yes right that is the first step. And after that you have to set the filetype of the files you want to edit with multiple snippets to:

    set filetype=less.styl
    

    or

    set filetype=styl.less
    

    I've just tested it with the snipmate "official" fork and it works fine but I'm sure enough it should work with the original plugin too.