diff --git a/packages/espanso-verbose-form-template/README.md b/packages/espanso-verbose-form-template/README.md new file mode 100644 index 00000000..44f6aa2d --- /dev/null +++ b/packages/espanso-verbose-form-template/README.md @@ -0,0 +1,68 @@ +# Espanso Choice Extension Shortcut + +> This package allows you to quickly create a new espanso shortcut with the choice extension. Please see the example below. + + +## Usage + +Let's say you want to create a new espanso shortcut that will allow you to choose between different options such as a list of colors that you frequently use in styling. Or you have a list of co-worker logins that you need to use but can't always remember off hand. You can use the choice extension to quickly generate a shortcut template that you can customize to give you a list of options to choose from. + + +Please see [![espanso-verbose-form-template](https://img.youtube.com/vi/videoid/0.jpg)](https://www.youtube.com/watch?v=VEGv4aHV1d8) +for a short video demo + + +```yaml + +# Example usage + + - triggers: ['csscolors--', 'csscol--'] + replace: "color: {{CSS.color_name}}" + vars: + - name: "CSS" + type: form + params: + layout: "color_name: [[color_name]]" + fields: + color_name: + type: list + values: + - red + - orange + - black + - white + - green + - blue + - purple + - pink + - yellow + - brown + - gray + - cyan + - magenta + - lime + - teal + - indigo + - violet + - fuchsia + - aqua + - maroon + - navy + - olive + - silver + - limegreen + - skyblue + - tan + +``` + +## Source + +Please refer to the awesome documentation for verbose syntax forms here https://espanso.org/docs/matches/forms/#controls-with-the-verbose-syntax + +![espanso-choice-extension-template](./verbose-form.jpeg) + + +## Notes + +I added manual unicode value for white space `\u0020` and `\n` for new line. This is because I had issues with vscode settings interfering with my YAML spacing and I found that just writing shortcuts like this was easier. \ No newline at end of file diff --git a/packages/espanso-verbose-form-template/_manifest.yml b/packages/espanso-verbose-form-template/_manifest.yml new file mode 100644 index 00000000..2020f70f --- /dev/null +++ b/packages/espanso-verbose-form-template/_manifest.yml @@ -0,0 +1,7 @@ +name: espanso-verbose-form-template +version: 1.0.0 +author: Omar Elmenawi +description: Espanso shortcode to create espanso shortcuts with the choice extension +tags: ["espanso", "shortcut", "template", "choice-extension"] + + diff --git a/packages/espanso-verbose-form-template/package.yml b/packages/espanso-verbose-form-template/package.yml new file mode 100644 index 00000000..5bc45e7e --- /dev/null +++ b/packages/espanso-verbose-form-template/package.yml @@ -0,0 +1,25 @@ +matches: + + - trigger: 'verboseform:' + replace: "\u0020\u0020-\u0020triggers:\u0020['{{FORM.trigger}}']\n\u0020\u0020\u0020\u0020replace:\u0020\"{{FORM.replace}}\u0020{{{{FORM.form_name}}.{{FORM.variable}}}}\"\n\u0020\u0020\u0020\u0020vars:\n\u0020\u0020\u0020\u0020\u0020\u0020-\u0020name:\u0020\"{{FORM.form_name}}\"\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020type:\u0020form\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020params:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020layout:\u0020\"{{FORM.variable}}:\u0020[[{{FORM.variable}}]]\"\u0020\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020fields:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020{{FORM.variable}}:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020type:\u0020list\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020values:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_one}}\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_two}}\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_three}}" + vars: + - name: "FORM" + type: form + params: + layout: "Form_Name: [[form_name]] Form_Trigger: [[trigger]] Form_Replace: [[replace]] Form_Variable: [[variable]] Form_List_Option_One: [[list_option_one]] Form_List_Option_Two: [[list_option_two]] Form_List_Option_Three: [[list_option_three]]" + fields: + form_name: + trigger: + variable: + replace: + var_type: + list_option_one: + label: "Espanso: Form - Verbose" + description: | + - Allows you to specify : + - form name + - trigger + - variable + - replace + - three starter list options + diff --git a/packages/espanso-verbose-form-template/verbose-form.jpeg b/packages/espanso-verbose-form-template/verbose-form.jpeg new file mode 100644 index 00000000..bfc6abf9 Binary files /dev/null and b/packages/espanso-verbose-form-template/verbose-form.jpeg differ