First commit.

This commit is contained in:
kj
2022-03-29 19:21:13 -04:00
commit da8f068975
293 changed files with 3002 additions and 0 deletions

6
snippets/js-mode/Math Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Math.
# key: M
# uuid: M
# --
Math.$0

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: addEventListener
# key: ael
# uuid: ael
# --
`(unless (eq (char-before) ?.) ".")`addEventListener('${1:DOMContentLoaded}', () => {
`%`$0
})`(if (eolp) ";")`

6
snippets/js-mode/alert Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: alert
# key: al
# uuid: al
# --
alert(${0:`%`});

6
snippets/js-mode/arrow Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: arrow function
# key: =>
# uuid: =>
# --
$1 => `(if (> (doom-snippets-count-lines %) 1) (concat "{ " (doom-snippets-format "%n%s%n") " }") %)`$0

6
snippets/js-mode/cl Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: class
# uuid: cl
# type: command
# --
(doom-snippets-expand :uuid "class")

6
snippets/js-mode/class Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: class
# --
class ${1:Name} {
$0
}

6
snippets/js-mode/const Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: const ... = ...;
# key: con
# uuid: con
# --
const ${1:name} = ${0:`%`};

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: constructor() { ... }
# --
constructor($1) {
`%`$0
}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: decodeURI
# key: du
# uuid: du
# --
decodeURI(${1:`%`})`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: decodeURIComponent
# key: duc
# uuid: duc
# --
decodeURIComponent(${1:`%`})`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: document
# key: doc
# uuid: doc
# --
document.

6
snippets/js-mode/else Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: else
# --
else {
`%`$0
}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: encodeURI
# key: eu
# uuid: eu
# --
encodeURI(${1:`%`})`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: encodeURIComponent
# key: euc
# uuid: euc
# --
encodeURIComponent(${1:`%`})`(if (eolp) ";")`

6
snippets/js-mode/exports Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: module.exports = ...
# uuid: exports
# key: exp
# --
module.exports = `%`$0`(if (eolp) ";")`

6
snippets/js-mode/filter Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.filter(...)
# key: fil
# uuid: fil
# --
`(unless (eq (char-before) ?.) ".")`filter($0)`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.filter(item => {...})
# key: fil=>
# uuid: fil=>
# --
`(unless (eq (char-before) ?.) ".")`filter(${1:item} => `(if (> (doom-snippets-count-lines %) 1) (concat "{ " (doom-snippets-format "%n%s%n") " }") %)`$0)`(if (eolp) ";")`

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: arr.filter(function(item) {...})
# key: filfu
# uuid: filfu
# --
`(unless (eq (char-before) ?.) ".")`filter(function(${1:item}) {
`(doom-snippets-format "%n%s%n")`$0
})`(if (eolp) ";")`

View File

@ -0,0 +1,4 @@
# -*- mode: snippet -*-
# name: fireEvent
# --
fireEvent('$0')

8
snippets/js-mode/for Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: for (;;)
# key: for
# uuid: for
# --
for ($1;$2;$3) {
`%`$0
}

6
snippets/js-mode/forEach Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.forEach(...)
# key: fore
# uuid: fore
# --
`(unless (eq (char-before) ?.) ".")`forEach(`%`$0)`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.forEach((item) => {...})
# key: fore=>
# uuid: fore=>
# --
`(unless (eq (char-before) ?.) ".")`forEach(${1:item} => `(if (> (doom-snippets-count-lines %) 1) (concat "{ " (doom-snippets-format "%n%s%n") " }") %)`$0)`(if (eolp) ";")`

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: arr.forEach(function(item) {...})
# key: forefu
# uuid: forefu
# --
`(unless (eq (char-before) ?.) ".")`forEach(function(${1:item}) {
`(doom-snippets-format "%n%s%n")`$0
})`(if (eolp) ";")`

8
snippets/js-mode/fori Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: for (var i = 0; i < arr.length; ++i) { ... }
# key: fori
# uuid: fori
# --
for (var ${1:i} = ${2:0}; $1 < ${3:${4:arr}.length}; ++$1) {
`%`$0
}

8
snippets/js-mode/forin Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: for (key in list) { ... }
# key: forin
# uuid: forin
# --
for (${1:key} in ${2:list}) {
`%`$0
}

6
snippets/js-mode/fu Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: anonymous/named function
# key: fu
# type: command
# --
(doom-snippets-expand :uuid (if (doom-snippets-bolp) "function_block" "function_inline"))

View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: named function
# key: function
# uuid: function_block
# condition: (or (doom-snippets-bolp) (region-active-p))
# --
function ${1:name}($2) {
`(doom-snippets-format "%n%s%n")`$0
}

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: anonymous function
# key: function
# uuid: function_inline
# condition: (or (not (doom-snippets-bolp)) (region-active-p))
# --
function ($1) { `(doom-snippets-format "%n%s%n")`$0 }`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: getElementById
# key: gebi
# uuid: gebi
# --
`(unless (eq (char-before) ?.) ".")`getElementById(${1:id})`(if (eolp) ";")`

6
snippets/js-mode/if Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: if
# --
if (${1:true}) {
`%`$0
}

6
snippets/js-mode/imp Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: import ... from ...;
# uuid: imp
# type: command
# --
(doom-snippets-expand :uuid "import")

5
snippets/js-mode/import Normal file
View File

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: import ... from ...;
# uuid: import
# --
import ${1:Object} from '${2:./$3}';

6
snippets/js-mode/indexOf Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.indexOf(elt, fromIndex)
# key: iof
# uuid: iof
# --
`(unless (eq (char-before) ?.) ".")`indexOf(${1:`(or (doom-snippets-text nil t) "elt")`}${2: ${3:fromIndex}})`(if (eolp) ";")`

8
snippets/js-mode/jsdoc Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: /** ... */
# key: /**
# uuid: /**
# --
/**
* ${0:`(if % (s-replace "\n" "\n * " %))`}
*/

4
snippets/js-mode/let Normal file
View File

@ -0,0 +1,4 @@
# -*- mode: snippet -*-
# name: let ... = ...;
# --
let ${1:name} = ${0:`%`};

4
snippets/js-mode/log Normal file
View File

@ -0,0 +1,4 @@
# -*- mode: snippet -*-
# name: console.log("...");
# --
console.log(`(doom-snippets-text nil t)`$0)`(if (eolp) ";")`

6
snippets/js-mode/map Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.map(...)
# key: map
# uuid: map
# --
`(unless (eq (char-before) ?.) ".")`map($0)`(if (eolp) ";")`

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.map((item, i, arr) => {...})
# key: map=>
# uuid: map=>
# --
`(unless (eq (char-before) ?.) ".")`map((${1:item}, ${2:i}, ${3:arr}) => `(if (> (doom-snippets-count-lines %) 1) (concat "{ " (doom-snippets-format "%n%s%n") " }") %)`$0)`(if (eolp) ";")`

View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: arr.map(function(item, i, arr) {...})
# key: mapfu
# uuid: mapfu
# --
`(unless (eq (char-before) ?.) ".")`map(function(${1:item}, ${2:i}, ${3:arr}) {
`(doom-snippets-format "%n%s%n")`$0
})`(if (eolp) ";")`

8
snippets/js-mode/method Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: method() { ... }
# key: m
# uuid: m
# --
${1:method}($2) {
`%`$0
}

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: ...: ...
# key: :
# uuid: :
# --
${1:key}: ${0:value}

6
snippets/js-mode/push Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: arr.push(elt)
# key: pu
# uuid: pu
# --
`(unless (eq (char-before) ?.) ".")`push(`(doom-snippets-text nil t)`$0)`(if (eolp) ";")`

6
snippets/js-mode/req Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: require("...")
# uuid: req
# type: command
# --
(doom-snippets-expand :uuid "require")

5
snippets/js-mode/require Normal file
View File

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: require("...")
# uuid: require
# --
require(`%`$0)`(if (eolp) ";")`

6
snippets/js-mode/return Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: return ...
# key: r
# uuid: r
# --
return $0;

8
snippets/js-mode/try Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: try-catch block
# --
try {
`%`$0
} catch (${1:err}) {
${2:// Do something}
}

6
snippets/js-mode/var Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: var ... = ...;
# key: var
# uuid: var
# --
var ${1:name} = ${0:`%`};

4
snippets/js-mode/while Normal file
View File

@ -0,0 +1,4 @@
# -*- mode: snippet -*-
# name: while
# --
while (${1:true}) { ${0:`(doom-snippets-format "%n%s%n")`} }