Scratchpad - Code Snippet Manager
A VS Code extension that provides a persistent clipboard manager for developers. Save, organize, and retrieve code snippets within your workspace.
Features
Copy to Scratchpad
- Select any text in your editor and save it to your scratchpad
- Use the keyboard shortcut
Cmd+Shift+C (Mac) or Ctrl+Shift+C (Windows/Linux)
- Or right-click and select "Copy to Scratchpad" from the context menu
- Automatic language detection based on the source file
Side Panel View
- View all your snippets in the Explorer sidebar
- See snippet name, preview, and character count at a glance
- Hover for detailed tooltip with full preview and metadata
- Pinned snippets appear at the top
Snippet Management
- Rename: Give your snippets meaningful names
- Pin/Unpin: Keep important snippets at the top
- Delete: Remove snippets you no longer need
- View: Open full snippet content in a new editor tab
- Insert at Cursor: Paste snippet directly into your editor
- Copy to Clipboard: Copy snippet content to system clipboard
- Search: Filter snippets by name or content
Storage & Persistence
- Snippets are stored in
.vscode/scratchpad.json in your workspace
- Workspace-specific storage (not synced across workspaces)
- Persists across VS Code sessions
- Option to add storage file to
.gitignore
Cleanup & Limits
- Configurable maximum snippets (default: 100)
- Configurable maximum snippet size (default: 50,000 characters)
- Warning when approaching the snippet limit
- Automatic cleanup prompt for old snippets
- Pinned snippets are exempt from auto-cleanup
Usage
Saving a Snippet
- Select text in any editor
- Use
Cmd+Shift+C / Ctrl+Shift+C or right-click → "Copy to Scratchpad"
- The snippet is saved with an auto-generated name
Using a Snippet
- Find your snippet in the Scratchpad panel (Explorer sidebar)
- Right-click to:
- Insert at cursor position
- Copy to clipboard
- View full content
- Or double-click to view the full snippet
Managing Snippets
- Right-click any snippet for management options
- Use the search icon in the panel header to filter snippets
- Use the refresh icon to reload snippets from disk
- Use the clear icon to delete all snippets
Commands
| Command |
Description |
Copy to Scratchpad |
Save selected text to scratchpad |
Insert at Cursor |
Insert snippet at cursor position |
Copy to Clipboard |
Copy snippet to system clipboard |
View Full Snippet |
Open snippet in new editor tab |
Rename Snippet |
Change snippet name |
Pin/Unpin Snippet |
Toggle pin status |
Delete Snippet |
Remove snippet |
Clear All Snippets |
Remove all snippets |
Cleanup Old Snippets |
Review and delete old snippets |
Search Snippets |
Filter snippets by name or content |
Refresh Scratchpad |
Reload snippets from disk |
Settings
| Setting |
Default |
Description |
scratchpad.maxSnippets |
100 |
Maximum number of snippets |
scratchpad.maxSnippetSize |
50000 |
Maximum characters per snippet |
scratchpad.cleanupPeriodDays |
30 |
Days before cleanup prompt (15/30/60/90) |
scratchpad.showTimestamps |
true |
Show relative timestamps |
scratchpad.showCharacterCount |
true |
Show character count |
scratchpad.warningThreshold |
80 |
Percentage at which to warn about limit |
Keyboard Shortcuts
| Shortcut |
Command |
Cmd+Shift+C (Mac) / Ctrl+Shift+C (Win/Linux) |
Copy to Scratchpad |
You can customize this shortcut in VS Code's Keyboard Shortcuts settings.
Requirements
- VS Code version 1.85.0 or higher
- A workspace folder must be open to use the extension
Installation
From Source
- Clone this repository
- Run
npm install to install dependencies
- Run
npm run compile to build the extension
- Press
F5 to launch the extension in a new VS Code window
Building VSIX Package
- Run
npm install
- Run
npx vsce package
- Install the generated
.vsix file in VS Code
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch for changes
npm run watch
# Lint code
npm run lint
License
MIT
| |