Vim Tips Wiki


1,625pages on
this wiki
Add New Page

Use this page to discuss script 3249 Jasmine snippets: snipMate snippets for the Jasmine JavaScript BDD Framework

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.


This doesn't work out of the box; you need to do two things:

1. The file listing has lost its indentation so it flat does not work. For each snippet, you must indent the snippet text that will be generated.

i.e., instead of just copying the list like this:

snippet aft
afterEach(function() {

you need to edit it as:

snippet aft
  afterEach(function() {

2. Since jasmine code is a javascript file, this snippet doesn't get recognized; the javascript snippets file takes over. To define the jasmine snippets file, add this to your .vimrc file:

au BufRead,BufNewFile *[Ss]pec.js filetype=jasmine, syntax=javascript

That way, you'll get the jasmine snippets with javascript highlighting.

Of course, you may also want to use the standard javascript snippets, so that means either including the javascript snippets along with the jasmine snippets, or doing a cut-n-paste. This is left as an exercise for the reader. --August 25, 2012


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.