From: Kyle Bowman Date: Sat, 9 Nov 2024 20:51:14 +0000 (-0500) Subject: feat: add snippets to jetsam. X-Git-Url: https://git.rocketbowman.com/?a=commitdiff_plain;h=c7b39a4c7d4c389856700171cd28064e0d01e11e;p=jetsam.git feat: add snippets to jetsam. --- diff --git a/.vscode/rocky.code-snippets b/.vscode/rocky.code-snippets deleted file mode 100644 index 6fa94c6..0000000 --- a/.vscode/rocky.code-snippets +++ /dev/null @@ -1,99 +0,0 @@ -{ - // Place your notes 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" - // } - "Snippet Template":{ - "prefix": "snp", - "description": "Defines a snippet.", - "body": [ - "\"${1:name}\":{", - "\t\"prefix\":\"$2\",", - "\t\"description\":\"$3\",", - "\t\"body\": [ ", - "\t\t$0", - "\t]", - "}" - ], - }, - "MD Metadata":{ - "scope": "markdown", - "prefix": "mdmt", - "body": [ - "---", - "title: $1", - "author: Kyle Bowman", - "created: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND", - "---", - "", - "# $1", - "$0" - ], - "description": "Produces YAML metadata for summaries." - }, - "MD Bash":{ - "prefix":"bsh", - "description":"Creates a bash block.", - "body": [ - "``` bash", - "$0", - "```\n" - ], - "scope":"markdown" - }, - "MD Python":{ - "prefix":"py", - "description":"Creates a python block.", - "body": [ - "``` python", - "$0", - "```\n" - ], - "scope":"markdown" - }, - "MD Code":{ - "prefix":"```", - "description":"Creates a code block", - "body": [ - "``` $1", - "$0", - "```\n" - ], - "scope":"markdown" - }, - "MD Console Prefix":{ - "prefix":"term", - "description":"Inserts a dummy terminal prefix.", - "body": [ - "user@host:${1:~}$$0" - ] - }, - "MD Link Clipboard":{ - "prefix":"clp", - "description":"Inserts a md link from clipboard.", - "body": [ - "[$1]($CLIPBOARD)$0" - ] - }, - // Damn. I need to figure out how to make relative links work in both - // pandoc and vscode for things in different directories. - "MD Relative Link":{ - "prefix":"rel", - "description":"Inserts a link relative to file.", - "body": [ - "[[${1:link-text}|../${2:dir/file}]]$0" - ] - } -} \ No newline at end of file diff --git a/jetsam.code-snippets b/jetsam.code-snippets new file mode 100644 index 0000000..aea0aee --- /dev/null +++ b/jetsam.code-snippets @@ -0,0 +1,117 @@ +{ + // Place your notes 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" + // } + "Snippet Template":{ + "prefix": "snp", + "description": "Defines a snippet.", + "body": [ + "\"${1:name}\":{", + "\t\"prefix\":\"$2\",", + "\t\"description\":\"$3\",", + "\t\"body\": [ ", + "\t\t$0", + "\t]", + "}" + ], + }, + "MD Metadata":{ + "description": "Produces YAML metadata for summaries.", + "prefix": "mdmt", + "body": [ + "---", + "title: $1", + "author: Kyle Bowman", + "created: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND", + "last_updated: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND", + "---", + "", + "# $1", + "$0" + ], + "scope": "markdown" + }, + "MD Last Updated":{ + "prefix":"up", + "description":"", + "body": [ + "last_updated: $CURRENT_YEAR$CURRENT_MONTH$CURRENT_DATE$CURRENT_HOUR$CURRENT_MINUTE$CURRENT_SECOND", + ], + "scope":"markdown" + }, + "MD Bash":{ + "prefix":"bs", + "description":"Creates a bash block.", + "body": [ + "``` bash", + "$0", + "```\n" + ], + "scope":"markdown" + }, + "MD Python":{ + "prefix":"py", + "description":"Creates a python block.", + "body": [ + "``` python", + "$0", + "```\n" + ], + "scope":"markdown" + }, + "MD Code":{ + "prefix":"```", + "description":"Creates a code block", + "body": [ + "``` $1", + "$0", + "```\n" + ], + "scope":"markdown" + }, + "MD Console Prefix":{ + "prefix":"tm", + "description":"Inserts a dummy terminal prefix.", + "body": [ + "user@host:$$0" + ], + }, + "MD Link Clipboard":{ + "prefix":"lc", + "description":"Inserts a md link from clipboard.", + "body": [ + "[$1]($CLIPBOARD)$0" + ], + "scope": "markdown" + }, + "MD Relative Link":{ + "prefix":"ll", + "description":"Inserts a link relative to file.", + "body": [ + //exclude / from ../ b/c / triggers autocompletion + "[${1:link-text}](..${2:/dir/file})$0" + ], + "scope": "markdown" + }, + "MD Zettelkasten Link":{ + "prefix":"lz", + "description":"Inserts a link relative to file.", + "body": [ + "[${1:link-text}](../zettelkasten${2:/file})$0" + ], + "scope": "markdown" + } +} \ No newline at end of file