Update javascript snippets

main
Buddy Sandidge 4 years ago
parent e9ad5d2cf4
commit 5b93699df7

@ -1,4 +1,4 @@
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'SirVer/ultisnips', { 'tag': '3.2' } Plug 'SirVer/ultisnips', { 'tag': '3.2' }
let g:UltiSnipsSnippetDirectories = [ 'UltiSnips', 'snips' ] let g:UltiSnipsSnippetDirectories = [ 'UltiSnips', 'snips' ]

@ -17,50 +17,49 @@ snippet scf "self calling function" !
endsnippet endsnippet
snippet log "console.log" snippet log "console.log"
console.log(${1:'${2:value}'}) console.log(${1:'${2:value}'});
endsnippet endsnippet
snippet strict "use strict" snippet strict "use strict"
'use strict' 'use strict';
endsnippet endsnippet
snippet timeout "setTimeout" ! snippet timeout "setTimeout" !
setTimeout(function () { setTimeout(function () {
${1://code} ${1://code}
}, 0) }, 0);
endsnippet endsnippet
snippet it "it test case" ! snippet it "it test case" !
it('→ $1', () => { it('→ $1', () => {
}) });
endsnippet endsnippet
snippet desc "describe test case" ! snippet desc "describe test case" !
describe('→ $1', () => { describe('→ $1', () => {
}) });
endsnippet endsnippet
snippet exp "expect" b snippet exp "expect" b
expect($1).toBe($2) expect($1).toBe($2);
endsnippet endsnippet
snippet umd "Universal Module Definition" b snippet umd "Universal Module Definition" b
(function (root, factory) { (function (root, factory) {
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define(["${1:dependency}"], factory) define(["${1:dependency}"], factory);
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
module.exports = factory(require("$1")) module.exports = factory(require("$1"));
} else { } else {
root.${2:Export} = factory(root.$1) root.${2:Export} = factory(root.$1);
} }
}(this, function ($1) { }(this, function ($1) {
function $2($3) { function $2($3) {
} }
return $2;
return $2
})) }))
endsnippet endsnippet
snippet debug "debugger" ! snippet debug "debugger" !
debugger$1 debugger$1;
endsnippet endsnippet

Loading…
Cancel
Save