From 5b93699df725747014807777665d8d36be891091 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Fri, 4 Jun 2021 20:43:48 -0700 Subject: [PATCH] Update javascript snippets --- vim-fancy/.config/vim/plug.d/vim-fancy.vim | 2 +- .../.config/vim/snips/javascript.snippets | 23 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/vim-fancy/.config/vim/plug.d/vim-fancy.vim b/vim-fancy/.config/vim/plug.d/vim-fancy.vim index 4bb8e37..b0a32dd 100644 --- a/vim-fancy/.config/vim/plug.d/vim-fancy.vim +++ b/vim-fancy/.config/vim/plug.d/vim-fancy.vim @@ -1,4 +1,4 @@ -Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'neoclide/coc.nvim', { 'branch': 'release' } Plug 'SirVer/ultisnips', { 'tag': '3.2' } let g:UltiSnipsSnippetDirectories = [ 'UltiSnips', 'snips' ] diff --git a/vim-fancy/.config/vim/snips/javascript.snippets b/vim-fancy/.config/vim/snips/javascript.snippets index 5556598..85c9a93 100644 --- a/vim-fancy/.config/vim/snips/javascript.snippets +++ b/vim-fancy/.config/vim/snips/javascript.snippets @@ -17,50 +17,49 @@ snippet scf "self calling function" ! endsnippet snippet log "console.log" -console.log(${1:'${2:value}'}) +console.log(${1:'${2:value}'}); endsnippet snippet strict "use strict" -'use strict' +'use strict'; endsnippet snippet timeout "setTimeout" ! setTimeout(function () { ${1://code} -}, 0) +}, 0); endsnippet snippet it "it test case" ! it('→ $1', () => { -}) +}); endsnippet snippet desc "describe test case" ! describe('→ $1', () => { -}) +}); endsnippet snippet exp "expect" b -expect($1).toBe($2) +expect($1).toBe($2); endsnippet snippet umd "Universal Module Definition" b (function (root, factory) { if (typeof define === "function" && define.amd) { - define(["${1:dependency}"], factory) + define(["${1:dependency}"], factory); } else if (typeof exports === "object") { - module.exports = factory(require("$1")) + module.exports = factory(require("$1")); } else { - root.${2:Export} = factory(root.$1) + root.${2:Export} = factory(root.$1); } }(this, function ($1) { function $2($3) { } - - return $2 + return $2; })) endsnippet snippet debug "debugger" ! -debugger$1 +debugger$1; endsnippet