From 621832506cc9f83c0ddfc4d5427ec8fdfa608d49 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Wed, 20 Mar 2024 21:45:23 +0100 Subject: [PATCH] :bug: :zap: ultisnips includes hotfixed by script --- .config/coc/ultisnips/html.snippets | 28 +- .config/coc/ultisnips/markdown.snippets | 62 +- .config/coc/ultisnips/php.snippets | 2371 +++++++++++++++++++++++ .config/coc/ultisnips/vue.snippets | 123 ++ bin/§ultisnips.mjs | 14 + 5 files changed, 2548 insertions(+), 50 deletions(-) create mode 100755 bin/§ultisnips.mjs diff --git a/.config/coc/ultisnips/html.snippets b/.config/coc/ultisnips/html.snippets index 5377d60..16ca214 100644 --- a/.config/coc/ultisnips/html.snippets +++ b/.config/coc/ultisnips/html.snippets @@ -1,28 +1,3 @@ -# A valid snippet should starts with: -# -# snippet trigger_word [ "description" [ options ] ] -# -# and end with: -# -# endsnippet -# -# Snippet options: -# -# b - Beginning of line. -# i - In-word expansion. -# w - Word boundary. -# r - Regular expression -# e - Custom context snippet -# A - Snippet will be triggered automatically, when condition matches. -# -# Basic example: -# -# snippet emitter "emitter properties" b -# private readonly ${1} = new Emitter<$2>() -# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event -# endsnippet -# -# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt snippet sceleton "HTML5" b @@ -50,6 +25,9 @@ endsnippet snippet cmt "comment" endsnippet +snippet cmt.js "comment" +/* ${0} */ +endsnippet snippet viewport_cordova "viewport used in cordova apps" diff --git a/.config/coc/ultisnips/markdown.snippets b/.config/coc/ultisnips/markdown.snippets index caf3f05..5bf5d81 100644 --- a/.config/coc/ultisnips/markdown.snippets +++ b/.config/coc/ultisnips/markdown.snippets @@ -1,25 +1,37 @@ -# A valid snippet should starts with: -# -# snippet trigger_word [ "description" [ options ] ] -# -# and end with: -# -# endsnippet -# -# Snippet options: -# -# b - Beginning of line. -# i - In-word expansion. -# w - Word boundary. -# r - Regular expression -# e - Custom context snippet -# A - Snippet will be triggered automatically, when condition matches. -# -# Basic example: -# -# snippet emitter "emitter properties" b -# private readonly ${1} = new Emitter<$2>() -# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event -# endsnippet -# -# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt +extends html +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends diff --git a/.config/coc/ultisnips/php.snippets b/.config/coc/ultisnips/php.snippets index a852766..0572a81 100644 --- a/.config/coc/ultisnips/php.snippets +++ b/.config/coc/ultisnips/php.snippets @@ -1 +1,2372 @@ extends php, html +extends php, html +extends php, html +extends php, html +extends php, html +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +extends php, html +#endextends + +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet + +#endextends \ No newline at end of file diff --git a/.config/coc/ultisnips/vue.snippets b/.config/coc/ultisnips/vue.snippets index 21f3819..84835b2 100644 --- a/.config/coc/ultisnips/vue.snippets +++ b/.config/coc/ultisnips/vue.snippets @@ -1 +1,124 @@ extends javascript, html +snippet sceleton_node "nodejs" b +#!/usr/bin/env node +/* jshint esversion: 8,-W097, -W040, node: true, expr: true, undef: true */ +${0} +endsnippet +snippet sceleton_cli "nodejsscript" b +#!/usr/bin/env nodejsscript +/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */ +${0} +endsnippet +snippet sceleton_zx "zx" b +#!/usr/bin/env zx +/* jshint esversion: 8,-W097, -W040, node: true, expr: true, undef: true */ +${0} +endsnippet +snippet jshint "JSHint header" b +/* jshint esversion: 6,-W097, -W040, browser: true, expr: true, undef: true */ +/* global ${0} */ +endsnippet +snippet global "JSHint global" +/* global ${0} */ +endsnippet +snippet global_ns "JSHint global" +/* ${1} *//* global ${0} */ +endsnippet +snippet devel "JSHint devel" +${1}/* jshint devel: true *///gulp.keep.line${0} +endsnippet + +snippet log "console.log" +${1}console.log('${0}'); +endsnippet +snippet stor "localStorage" +${1}localStorage.${2:g}etItem("${0}"); +endsnippet + +snippet import "import with backward order" +import ${2:values} from "${1:specifier}";$0 +endsnippet +snippet promise "return? new Promise" +${1:return }new Promise(function(resolve, reject){ + ${0:/* async code */} +}); +endsnippet +snippet for "classical loop" +for(${1:let} ${2:i}= 0, ${2}_length= ${3:ITERABLE}.length; ${2}<${2}_length; ${2}++){ + ${0:/* statement */} +} +endsnippet +snippet foreach "PHP-like name" b +for(${2:const} ${3:element} of ${1:iterable}){ + ${0:/* statement */} +} +endsnippet +snippet switch "classical switch" +switch (${1}){ + case ${2}: + ${0} + break; + default: +} +endsnippet +snippet desctr "object destructure" +${1:const} { $0 }= ${2:def}; +endsnippet +snippet ready "document ready" +${1}document.addEventListener('DOMContentLoaded', ${0}, false) +endsnippet +snippet readyEvent "vanilla JS content ready event name" +${1}DOMContentLoaded${0} +endsnippet + +snippet selid +${1}document.getElementById('${0}') +endsnippet +snippet seltag +${1}getElementsByTagName('${0}') +endsnippet +snippet selclass +${1}getElementsByClassName('${0}') +endsnippet +snippet sel +${1}querySelector('${0}') +endsnippet +snippet selall +${1}querySelectorAll('${0}') +endsnippet +snippet sceleton "HTML5" b + + + + + + + + + + + + + + + + + + + + + +endsnippet + +snippet cmt "comment" + +endsnippet + +snippet viewport_cordova "viewport used in cordova apps" + +endsnippet +snippet csp_cordova "CSP used in cordova" + + +endsnippet +#endextends \ No newline at end of file diff --git a/bin/§ultisnips.mjs b/bin/§ultisnips.mjs new file mode 100755 index 0000000..4100e11 --- /dev/null +++ b/bin/§ultisnips.mjs @@ -0,0 +1,14 @@ +#!/usr/bin/env nodejsscript +/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */ +$.is_fatal= true; +const root= "~/.config/coc/ultisnips/"; +const files= Object.fromEntries( s.ls(root).map(fn=> [fn, s.cat(root+fn).trim()]) ); +Object.keys(files).forEach(fn=> { + const file= files[fn]; + if(!file.startsWith("extends ")) return; + const lines= file.split("\n"); + const line_end= pipe( id=> id===-1 ? lines.length : id )( lines.findIndex(l=> l.startsWith("#endextends")) ); + const include= lines[0].replace("extends ", "").trim().split(/, ?/g).map(s=> files[s+".snippets"]).join("\n"); + lines.splice(1, line_end-1, include); + s.echo(lines.join("\n").trim()).to(root+fn); +})