You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
A VS Code extension that efficiently copies selected files as markdown with syntax highlighting and minimized content—perfect for sharing code context in documentation, issues, or chat applications.
A VS Code extension that efficiently copies selected files as markdown with syntax highlighting and minimized content—perfect for sharing code context in chat applications.
Features
🗂️ Copy for Context (Explorer)
Select multiple files in the VS Code Explorer
Right-click and choose"Copy for Context"
Copies selected files as formatted markdown with syntax highlighting
Includes relative file paths as headers
📄 Copy This File for Context
Right-click any tab title or use Command Palette
Copies the active file as markdown with proper syntax highlighting
Perfect for sharing individual file contents
📂 Copy This Tab Group for Context
Right-click any tab title or use Command Palette
Copies all files in the current tab group as formatted markdown
Great for sharing related files together
📋 Copy All Open Tabs for Context
Use Command Palette or right-click any tab title
Copies contents of all open tabs as markdown
Useful for sharing your entire working context
🎯 Copy Selected Files for Context
Right-click any tab title or use Command Palette
Opens a quick pick menu to select which open files to copy
Allows selective copying from all open tabs
🏗️ Copy Folder Structure Only
Right-click on any folder in the Explorer
Copies the directory tree structure without file contents
Perfect for sharing project organization
Shows folders (📁) and files (📄) with proper indentation
📁 Copy Folder Structure with File Structure
Right-click on any folder in the Explorer
Copies both the directory structure and all file contents
Ideal for sharing complete project context
Combines folder tree visualization with actual code
✂️ Copy Selection for Context
Select text in an editor and use keyboard shortcut (Ctrl+Shift+C /Cmd+Shift+C)
Copies the selected text as markdown with proper syntax highlighting
Includes file path and line numbers in the header
Perfect for sharing specific code snippets
🔢 Copy Selection with Line Numbers for Context
Select text in an editor and use keyboard shortcut (Ctrl+Shift+Alt+C /Cmd+Shift+Alt+C)
Copies the selected text with line numbers prefixed to each line
Ideal for referencing specific lines in discussions
🚫 Gitignore Support
Automatically respects.gitignore rules when copying folders
Excludes files and directories listed in.gitignore
Can be toggled on/off in settings
Works with all folder-related copy operations
Usage
From Explorer
Files
Select one or more files in the VS Code Explorer
Right-click on the selection
Choose"Copy for Context"
The formatted markdown is now in your clipboard
Folders
Right-click on any folder in the VS Code Explorer
Choose one of the folder options:
"Copy Folder Structure Only" - Gets directory tree without file contents
"Copy Folder Structure with File Structure" - Gets directory tree plus all file contents
The formatted markdown is now in your clipboard
From Tab Context Menu
Right-click on any tab title
Choose one of the copy options:
Copy This File for Context
Copy This Tab Group for Context
Copy All Open Tabs for Context
Copy Selected Files for Context
From Editor Context Menu
Select text in an editor
Right-click on the selection
Choose one of the copy options:
Copy Selection for Context
Copy Selection with Line Numbers for Context
Using Keyboard Shortcuts
Ctrl+Shift+C /Cmd+Shift+C - Copy Selection for Context
Ctrl+Shift+Alt+C /Cmd+Shift+Alt+C - Copy Selection with Line Numbers for Context
From Command Palette
Open Command Palette (Ctrl+Shift+P /Cmd+Shift+P)
Type "Copy" to see all available copy commands
Select the desired option
Output Format
File Contents
The extension generates clean markdown with:
File paths as level 2 headers (## path/to/file.js)
When enabled, copies the entire lines from start to end, rather than just the selected text
Gitignore Support
The extension includes intelligent.gitignore support:
Automatic Detection: Looks for.gitignore in your workspace root
Pattern Matching: Supports common gitignore patterns including:
Exact file/folder names (node_modules)
Wildcards (*.log,temp*)
Directory patterns (dist/,build/)
Path-based patterns (src/temp/)
Configurable: Can be disabled via settings if needed
Folder Operations: Only affects folder-related copy operations
Gitignore Examples
If your.gitignore contains:
node_modules/*.logdist.envtemp*
The extension will automatically exclude:
The entirenode_modules folder
Any.log files
Thedist folder
.env files
Any files/folders starting withtemp
Installation
From VS Code Marketplace
Open VS Code
Go to Extensions (Ctrl+Shift+X)
Search for "Copy for Context"
Click Install
Development Setup
Clone this repository
Runnpm install to install dependencies
Open in VS Code
PressF5 to launch Extension Development Host
Test the extension in the new VS Code window
Building
Runnpm run compile to build the extension
Usevsce package to create a.vsix file for installation
Requirements
VS Code version 1.74.0 or higher
Contributing
Feel free to submit issues and enhancement requests!
License
MIT License - feel free to use this extension in your projects.
About
A VS Code extension that efficiently copies selected files as markdown with syntax highlighting and minimized content—perfect for sharing code context in documentation, issues, or chat applications.