ChatSnippets

中文版说明请见 README.zh-CN.md
Manage frequently-used text snippets, copy them with one click, and auto-paste into AI chat input boxes.
Features
- Tree view in the sidebar, organized by category
- Click a node → auto-copy to clipboard → auto-paste after 1.5s delay
- Data stored in YAML files, supports Git version control and manual editing
- Supports workspace-level, user-level, and custom-path storage modes
YAML File Location
The extension looks for chat-snippets.yaml in the following order (unless chatSnippets.filePath is set):
1. Workspace-level — scoped to the current project, shareable via Git
your-project/.vscode/chat-snippets.yaml
2. User-level — global across all workspaces, personal to you
~/.vscode/chat-snippets.yaml
3. Custom path — any location on disk, configured in VSCode settings
// settings.json
{
"chatSnippets.filePath": "/path/to/your/snippets.yaml"
}
Priority: The extension uses the first file it finds. To combine multiple files, set chatSnippets.mergeStrategy to "merge". See Configuration below.
Usage
- Click a Snippet node in the sidebar
- Content is automatically copied to the clipboard
- Focus on the AI chat input within the delay period
- Auto-paste completes the action
Configuration
| Setting |
Default |
Description |
chatSnippets.filePath |
"" |
Absolute path to YAML file (empty = auto-detect) |
chatSnippets.mergeStrategy |
"first" |
Multi-file merge strategy (first / merge) |
chatSnippets.pasteDelay |
1500 |
Delay in milliseconds before auto-paste |
chatSnippets.appendNewline |
false |
Always append a newline after the content |
Terminal users: In terminals (e.g., Claude Code terminal), focus management is more direct. Set pasteDelay to 100 ms for nearly instant pasting.
Define your snippets in .vscode/chat-snippets.yaml:
version: 1
snippets:
- name: Code Review
content: |
Please review the following code changes, focusing on:
1. Logical correctness
2. Potential performance issues
3. Code style consistency
category: General
- name: Commit Message
content: |
feat: brief description of changes
category: General
- name: Component
content: |
Please generate an Angular component with template and styles.
category: Angular
Development
pnpm run watch # Watch mode compilation
pnpm run compile # Compile once
pnpm run package # Package .vsix
pnpm run typecheck # Type-check without emitting
Press F5 to launch the Extension Development Host for debugging.
License
MIT © 2026 cipchk
Built from scratch with the assistance of DeepSeek.