A Visual Studio Code extension that streamlines code snippet creation by allowing developers to generate reusable snippets directly from selected code without manual JSON editing or file navigation.
Traditional snippet creation in VS Code involves navigating to snippet files, manually writing JSON configurations, and managing complex file structures. Snippetizer eliminates this workflow complexity by providing a direct path from code selection to snippet creation.
Snippetizer addresses these challenges through a streamlined workflow:
- Select code in the active editor
- Invoke the snippet creation command
- Provide snippet metadata through guided prompts
- Automatic snippet file management and JSON generation
- Direct Integration: Create snippets without leaving the current editor context
- Automated File Management: Handles VS Code snippet directory structure across platforms
- Cross-Platform Compatibility: Supports Windows, macOS, and Linux environments
- Input Validation: Ensures snippet names and prefixes follow VS Code conventions
- Flexible Organization: Supports both existing snippet files and new file creation
- Context Menu Integration: Available through right-click menu when text is selected
Using the "View Snippets" command to browse available snippets
- Select the target code in the editor
- Open Command Palette (
Ctrl+Shift+P
on Windows/Linux,⌘+Shift+P
on macOS) - Execute "Snippetizer: Create Snippet"
- Complete the prompted fields for snippet configuration
- Select code in the active editor
- Access the context menu via right-click
- Select "Snippetizer: Create Snippet"
- Provide required snippet metadata
Configure a custom keybinding in keybindings.json
:
{
"key": "ctrl+shift+s",
"command": "snippetizer.createSnippet",
"when": "editorHasSelection",
"key": "ctrl+shift+v",
"command": "snippetizer.veiwSnippets"
}
- Snippet Names: Use descriptive, meaningful identifiers
- Prefixes: Choose unique, memorable trigger sequences
- Descriptions: Optional field for snippet documentation
- File Organization: Organize snippets by language or functional domain
- Naming Conventions: Follow consistent patterns for maintainability
We welcome contributions to improve Snippetizer:
- Issue Reports: Submit bug reports
- Feature Requests: Request enhancements
- Code Contributions: Fork the repository and submit pull requests
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, issues, or feature requests, please use the GitHub issue tracker or contribute to the project repository.