Sirupsen/vim-execrus — pull request #8 by clauswitt (2013-03-19 21:00:47+00:00)
Title: New (additional) defaults for running javascript

These cover my use cases - not sure if they are generally usable however.

if there is a Gruntfile.js file in the root dir, run yeoman (without params)
if there is a grunt.js file in the root dir, run grunt (without params)
if there is a package.json file in the root dir, run npm test
if there is a index.html in the root dir, open that in a browser
if there is a index.html in the public dir below the root dir run that in a browser
otherwise run current file with node

... please beware, it's my first handwritten vimscript, so even though this code is simple, there may be some assumptions I have made, that are only valid on my system.