📝 Added trycatch espanso expansion

This commit is contained in:
z3rOR0ne 2023-08-31 20:04:17 -07:00
parent 7a3dde69d5
commit a47ec841a4
2 changed files with 15 additions and 1 deletions

View file

@ -108,7 +108,12 @@ matches:
replace: "() => {}"
- trigger: ";try"
replace: "try {} catch(error) {}"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "~/scripts/trycatch ; echo ''"
- trigger: ";def"
replace: "def():"

9
scripts/trycatch Executable file
View 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