Add CommonJS snippet

This commit is contained in:
Renzo Poddighe 2015-07-29 15:26:14 +02:00
parent f407b69097
commit 613d84e2ac

View File

@ -162,4 +162,10 @@ snippet req "require an AMD module"
require([${1:'dependencies'}], ${2:callback}); require([${1:'dependencies'}], ${2:callback});
endsnippet endsnippet
# CommonJS snippets
snippet vreq "assign a CommonJS-style module to a var"
var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('${1}');
endsnippet
# vim:ft=snippets: # vim:ft=snippets: