Jump to content

VSCodeSnippetManager - Manage VSCode Snippets Directly from Alfred


Recommended Posts

VSCodeSnippetManager - Easily Manage Your VSCode Snippets Directly from Alfred!

 

With this workflow, you can manage your Visual Studio Code (VSCode) snippets directly from Alfred. Create, read, update, and delete your snippets seamlessly without leaving Alfred.

 

 

VSCodeSnippetManager / GitHub Repository

 

Note: This workflow directly manipulates your VSCode snippet JSON files. If your JSON files contain comments, they will be removed during any operation. If preserving comments is important, consider adding them as JSON elements or refrain from using this workflow.

 

Installation

1. Download the Workflow  
   - Get the latest version from the GitHub Releases page

2. Install the Workflow  
   - Double-click the downloaded `.alfredworkflow` file to install it in Alfred.

3. Set Environment Variables (if needed)  
   - Ensure that the `vscode_snippets_dir` environment variable points to your VSCode snippets directory. The default path is set to:
 

~/Library/Application Support/Code/User/snippets/


   - If the default path does not work for your setup, find the correct snippets directory path and update the environment variable accordingly.

 

 

How to Use

1. Enter Commands  
   Open Alfred and type the default command keywords (`snc`, `snr`, `snu`, `snd`), followed by a space and the programming language.  
   Example: `snc python` (Create a Python snippet)

2. Select the Operation and Execute  
   After entering the command and selecting the language, you can proceed with the snippet operation (Create, Read, Update, Delete).

 

 

Create a Snippet

1. Copy the code you want to add as a snippet to your clipboard.  
2. Open Alfred, type `snc` followed by the language, and choose the language from the suggestions.  
3. Enter the snippet prefix and press Enter to register the snippet.  
4. The clipboard content will be added as a new snippet in your VSCode.

Read, update, and delete operations follow a similar procedure.

 

 

Edited by karutt
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...