From 78b236e8842d7e1b1a71804e06c6be9335b4d305 Mon Sep 17 00:00:00 2001 From: Nathaniel Landau Date: Mon, 23 Aug 2021 14:10:02 -0400 Subject: [PATCH] initial commit --- .vscode/shellscript.code-snippets | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .vscode/shellscript.code-snippets diff --git a/.vscode/shellscript.code-snippets b/.vscode/shellscript.code-snippets new file mode 100644 index 0000000..6e13969 --- /dev/null +++ b/.vscode/shellscript.code-snippets @@ -0,0 +1,68 @@ +{ + // Place your dotfiles-private workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + // "Print to console": { + // "scope": "javascript,typescript", + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + "Comment block": { + "scope": "shellscript", + "prefix": "_c", + "body": [ + "# DESC:$1", + "# ARGS:\t\t${2:None}", + "# OUTS:\t\t${3:None}", + "# USAGE:$4", + "# NOTE:$0" + ], + "description": "Comment block for a function" + }, + "value": { + "scope": "shellscript", + "prefix": "_", + "body": ["\"\\${$0}\""], + "description": "" + }, + "subshell": { + "scope": "shellscript", + "prefix": "__", + "body": ["\"\\$($0)\""], + "description": "" + }, + "_function_() {}": { + "scope": "shellscript", + "prefix": "_f", + "body": [ + "_${1:name}_() {", + "\t\t# DESC:$2", + "\t\t# ARGS:\t\t${3:None}", + "\t\t# OUTS:\t\t${4:None}", + "\t\t# USAGE:$5", + "\t\t# NOTE:$6", + "\t\t", + "\t\t echo \"Hello world\"", + "\t\t$0", + "}" + ], + "description": "Add a new function" + }, + "while read loop": { + "scope": "shellscript", + "prefix": "_w", + "body": [ + "while read -r ${1:VARIABLE}; do", + "\t\techo \"\\${${1:VARIABLE}}\"", + "done < <(COMMAND)" + ] + } +}