From 8b092ec8be37cc142bc4fe902a45a577f44a3a7f Mon Sep 17 00:00:00 2001 From: Daniel Heras Quesada Date: Tue, 8 Jul 2025 17:19:33 +0200 Subject: [PATCH] feat: new snippets --- snippets/javascript.json | 7 +++++++ snippets/plaintext.json | 12 ++++++++++++ snippets/typescript.json | 20 ++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 snippets/javascript.json create mode 100644 snippets/plaintext.json create mode 100644 snippets/typescript.json diff --git a/snippets/javascript.json b/snippets/javascript.json new file mode 100644 index 0000000..3555551 --- /dev/null +++ b/snippets/javascript.json @@ -0,0 +1,7 @@ +{ + "Log to console": { + "prefix": "console", + "body": ["console.info(\"__${1:Place}!\")", "$0"], + "description": "Logs to console" + } +} diff --git a/snippets/plaintext.json b/snippets/plaintext.json new file mode 100644 index 0000000..3fd9ac0 --- /dev/null +++ b/snippets/plaintext.json @@ -0,0 +1,12 @@ +{ + // Each snippet must have a name and body, but the prefix and description are optional. + // The prefix is used to trigger the snippet, but when omitted then the name is used. + // Use placeholders like $1, $2 or ${1:defaultValue} to define tab stops. + // The $0 determines the final cursor position. + // Placeholders with the same value are linked. + "Log to console": { + "prefix": "log", + "body": ["console.info(\"Hello, ${1:World}!\")", "$0"], + "description": "Logs to console" + } +} diff --git a/snippets/typescript.json b/snippets/typescript.json new file mode 100644 index 0000000..d0185d2 --- /dev/null +++ b/snippets/typescript.json @@ -0,0 +1,20 @@ +{ + "Log to console": { + "prefix": "console log", + "body": ["console.info(\"__${1:Place}\", {${2:Value}})", "$0"], + "description": "Logs to console" + }, + "Defines a function": { + "prefix": "function", + "body": ["function ${1:Name}(${2:args}) {\n\t${3}\n}", "$0"], + "description": "Defines a function" + }, + "Defienes a JSX component": { + "prefix": "jsx component", + "body": [ + "export function ${1:Name}(${2:args}): React.FC<${3}> {\n\t${4}\n}", + "$0" + ], + "description": "Defines a JSX component" + } +}