Skip to content
ProdyPanda edited this page Oct 7, 2024 · 1 revision

Copy All Tabs to New Tab - VS Code Extension Wiki

Welcome to the official wiki for the Copy All Tabs to New Tab extension for Visual Studio Code! This wiki provides comprehensive documentation on installation, features, usage, and configuration.

Table of Contents

  1. Overview
  2. Installation
  3. Key Features
  4. Usage Guide
  5. Configuration Options
  6. Use Cases
  7. File Tree Feature
  8. Troubleshooting
  9. Contributing
  10. Release Notes

Overview

Copy All Tabs to New Tab is a powerful Visual Studio Code extension that allows you to effortlessly compile and share your entire project context. Whether you're working with AI code assistants, conducting code reviews, or preparing documentation, this extension streamlines your workflow by making it easy to copy the content of multiple tabs into a new tab or directly to your clipboard.

Why Use This Extension?

  • Streamlined Context Sharing: Quickly gather all relevant code files for AI assistance, code reviews, or debugging
  • Enhanced Documentation: Generate comprehensive snapshots of your project structure
  • Flexible Output Options: Choose between copying to a new tab or directly to clipboard
  • Customizable Experience: Extensive configuration options to tailor the output to your needs

Installation

  1. Open Visual Studio Code
  2. Access the Extensions view:
    • Windows/Linux: Ctrl+Shift+X
    • macOS: Cmd+Shift+X
  3. Search for "Copy All Tabs to New Tab"
  4. Click Install

Alternatively, you can install it from the Visual Studio Code Marketplace.

Key Features

  • Multi-Mode Operation: Copy to new tab or clipboard
  • Selective Copying: Copy all tabs or only selected ones
  • Custom Formatting: Define your own format for copied content
  • File Tree Generation: Include a structured file tree for better context
  • Configurable Output: Control what gets included in the copied content
  • Status Bar Integration: Quick access to all features
  • Keyboard Shortcuts: Efficiently trigger actions

Usage Guide

Basic Usage

Copying All Tabs

  1. Click the "$(files) Copy All" button in the status bar
  2. Or use the Command Palette (F1 or Ctrl+Shift+P) and search for "Copy All Tabs to New Tab"
  3. Or use the keyboard shortcut: Ctrl+Shift+C (Windows/Linux) or Cmd+Shift+C (macOS)

Copying Selected Tabs

  1. Click the "$(list-selection) Copy Selected" button in the status bar
  2. Choose the tabs you want to copy from the quick pick menu
  3. Or use the keyboard shortcut: Ctrl+Shift+S (Windows/Linux) or Cmd+Shift+S (macOS)

Clipboard Mode

Toggle between copying to a new tab or directly to clipboard:

  1. Click the clipboard mode indicator in the status bar (shows either "$(clippy) Clipboard Mode" or "$(window) Tab Mode")
  2. Or use the Command Palette and search for "Toggle Clipboard Mode"
  3. Or use the keyboard shortcut: Ctrl+Shift+T (Windows/Linux) or Cmd+Shift+T (macOS)

Custom Formatting

  1. Click the "$(settings-gear) Copy Custom" button in the status bar
  2. Enter your custom format using the following placeholders:
    • {filename}: Will be replaced with the file name
    • {content}: Will be replaced with the file content
    • {separator}: Will be replaced with the configured separator
    • [NL]: Will be replaced with a new line

Example format:

// {filename}[NL][NL]{content}[NL][NL]{separator}[NL][NL]

Keyboard Shortcuts

Action Windows/Linux macOS
Copy All Tabs Ctrl+Shift+C Cmd+Shift+C
Copy Selected Tabs Ctrl+Shift+S Cmd+Shift+S
Copy with Custom Format Ctrl+Shift+F Cmd+Shift+F
Toggle Clipboard Mode Ctrl+Shift+T Cmd+Shift+T

Configuration Options

To customize the extension, go to VS Code settings (Ctrl+, or Cmd+,) and search for "Copy All Tabs". Available options:

Setting Description Default
copytabs.copyToClipboard Copy directly to clipboard instead of new tab false
copytabs.includeFileTypes File types to include (empty = all) []
copytabs.excludeFileTypes File types to exclude []
copytabs.separatorLine Separator between files ------------------------
copytabs.includeComments Include comments in copied content true
copytabs.includeLineNumbers Include line numbers false
copytabs.includeFileTree Include structured file tree true
copytabs.structuredTreePosition Position of file tree (start/end) start
copytabs.showCopyAllButton Show "Copy All" in status bar true
copytabs.showCopySelectedButton Show "Copy Selected" in status bar true
copytabs.showCopyCustomButton Show "Copy Custom" in status bar true

Use Cases

1. AI Code Assistance

graph TD
    A[Open relevant files] --> B[Copy all tabs]
    B --> C[Paste into AI assistant]
    C --> D[Get context-aware help]
Loading

2. Code Reviews

  1. Open all changed files
  2. Use "Copy Selected Tabs" to choose relevant files
  3. Share the compiled code with reviewers

3. Documentation

Generate a comprehensive overview of your project structure and contents for:

  • Onboarding new team members
  • Creating technical documentation
  • Preparing tutorials or examples

4. Debugging

  1. Open files related to the bug
  2. Copy all relevant code
  3. Share in bug reports or support requests

File Tree Feature

The extension can generate a structured file tree of your opened tabs:

File Tree:
project-name/
├── src/
│   ├── components/
│   │   ├── Header.js
│   │   └── Footer.js
│   └── utils/
│       └── helpers.js
└── README.md

This feature provides:

  • Clear visualization of project structure
  • Better context for code reviews
  • Enhanced documentation

Troubleshooting

Common Issues

  1. Extension not appearing in status bar

    • Check if status bar buttons are enabled in settings
    • Try reloading VS Code
  2. Clipboard mode not working

    • Ensure you have granted clipboard permissions to VS Code
  3. Performance issues with large files

    • Try using "Copy Selected Tabs" instead of copying all tabs
    • Exclude unnecessary file types in settings

Getting Help

Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Please ensure you:

  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed

Release Notes

[0.2.0] - 2024-10-01

  • Added Clipboard Mode feature
  • New status bar item for toggling modes
  • Added copytabs.copyToClipboard configuration

[0.1.2] - 2024-08-07

  • Added configuration for status bar buttons visibility
  • Improved status bar customization

[0.1.1]

  • Added demonstration videos to README
  • Various bug fixes and improvements

[0.1.0]

  • Initial release
  • Added "Copy Selected Tabs" feature
  • Added "Copy Tabs with Custom Format"
  • Added structured file tree feature