Editing a Snippet
How to edit a generated or typed/pasted snippet and use it outside of Parrot.
Snippet editing in Parrot can be done on both generated snippets and type/pasted snippets. To edit a snippet, open the snippet you’d like to edit and type your changes into the appropriate code block. Parrot will automatically update your snippet in the background (no need to click a “save” button).
A snippet has three parts, all of which can be edited:
- The code blocks that make up your snippet.
- The example usage for your snippet.
- The documentation for your snippet (editable as Markdown).
Optionally, you can also add new code blocks to the snippet code by clicking the “Add a Code Block” button beneath the last code block’s editor.
Editing Your Snippet’s Settings
Currently, the following fields can be edited on a snippet:
- The name of the snippet.
- The project the snippet belongs to.
- The tags for snippet (used by Parrot when searching existing snippets).
- The keyboard shortcut you’d like to use in your IDE (automatically assigned when copying or exporting your snippets for your IDE).
Changes to your snippet’s settings are not automatic. Once you’ve made your changes, click the “Save Snippet Settings” at the bottom of the settings panel.
Copying a Snippet for Your IDE
While the recommended way to copy snippets for your IDE is to use the Export IDE Snippets feature (so you can export all of your snippets as a single file), you can optionally copy an individual snippet via the snippet editor.
Above the code input for your snippet, click the icon for your IDE (currently, Parrot supports VSCode snippets and Sublime Text completions).
You can also copy your snippet as plain text if you’d like to use it elsewhere (e.g., in an unsupported IDE).
Deleting a Snippet
If you no longer need a snippet—or want to clear up space for new snippets—you can delete a snippet via the snippet editor. Open the snippet you’d like to delete and scroll down to the bottom of the editor and click the “Delete Snippet” link on the right side of the red warning text. Parrot will confirm that you want to delete the snippet before deleting it.