📝 Added trycatch espanso expansion
This commit is contained in:
parent
7a3dde69d5
commit
a47ec841a4
2 changed files with 15 additions and 1 deletions
|
|
@ -108,7 +108,12 @@ matches:
|
||||||
replace: "() => {}"
|
replace: "() => {}"
|
||||||
|
|
||||||
- trigger: ";try"
|
- trigger: ";try"
|
||||||
replace: "try {} catch(error) {}"
|
replace: "{{output}}"
|
||||||
|
vars:
|
||||||
|
- name: output
|
||||||
|
type: shell
|
||||||
|
params:
|
||||||
|
cmd: "~/scripts/trycatch ; echo ''"
|
||||||
|
|
||||||
- trigger: ";def"
|
- trigger: ";def"
|
||||||
replace: "def():"
|
replace: "def():"
|
||||||
|
|
|
||||||
9
scripts/trycatch
Executable file
9
scripts/trycatch
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# use in conjunction with espanso to automatically print a javascript
|
||||||
|
# try/catch statement
|
||||||
|
cat <<EOM
|
||||||
|
try {
|
||||||
|
|
||||||
|
catch (err) {
|
||||||
|
|
||||||
|
EOM
|
||||||
Loading…
Add table
Add a link
Reference in a new issue