Create and Manage Snippets

You can create a snippet from the Snippets page or from a text selection in a code editor. You can only add one file when you create the snippet, but you can add more later.

This is how to create and manage a snippet:
Action How To

Create a snippet

  1. In the left navigator, click Snippets Snippets.
  2. Click + Create Snippet.

  3. On the Snippet Details page of the New Snippet wizard, enter the snippet name and description.

  4. In Visibility, select Private if you don’t want to share the snippet’s files and keep them for personal use. Select Shared to share the snippet’s files with project members.

  5. To edit the snippet and add more files immediately after creating the snippet, select Edit snippet when finished.

  6. Click Next.

  7. In the Snippet Content page of the New Snippet wizard, enter content for the default file of the snippet.

    If you don’t enter content, an empty file snippet1.txt will be added to the snippet.

  8. Click Finish.

Create a snippet from a selection

You can create a snippet from a file that’s open in the code editor.

  1. In the open file, select the text.

  2. Right-click and select New Snippet from Selection.

  3. On the Snippet Details page of the New Snippet wizard, enter the snippet name and description.

  4. In Visibility, select Private if you don’t want to share it and keep for personal use. Select Shared to share the snippet with project members.

  5. To edit the snippet and add more files immediately after creating the snippet, select Edit snippet when finished.

  6. In the Snippet Content page of the New Snippet wizard, enter content for the default file of the snippet.

    If you don’t enter content, an empty file is added to the snippet.

  7. Click Finish.

Share or stop sharing a snippet

After you create a snippet, you may want to share it with your team members, or you may want to stop sharing it if it is already shared. You can set the share status for any snippet that you own.

To share a snippet, in the My Snippets view of the Snippets page, click Share Share. The icon changes to Shared Shared. To stop sharing a snippet, click Shared Shared. The icon changes to Private Private.

Edit a snippet’s title

You can edit the title of a snippet that you own. On the Snippets page, click the snippet name, and then click Edit the Edit icon.

Delete a snippet

You can delete a snippet that you own. On the Snippets page, click the snippet name, and then click Delete. In the Delete Snippet dialog box, click Yes to confirm.