Description
vscode2prompt
is a Visual Studio Code extension that allows you to merge selected files or open tabs into a single file. This is particularly useful for preparing content to be used in chat applications like ChatGPT.
inspired by code2prompt
Features
- Merge Selected Files: Select multiple files from your workspace and merge their contents into a single virtual document.
- Merge Open Tabs: Merge the contents of all open text tabs into a single virtual document.
Installation
- Clone the repository or download the extension package.
- Open the project in Visual Studio Code.
- Run
npm install
to install the dependencies.
- Press
F5
to open a new VS Code window with the extension loaded.
Usage
Merge Selected Files
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
on macOS).
- Type
Merge Selected Files
and select the command.
- Choose the files you want to merge from the quick pick list.
- A new tab will open with the merged content.
Merge Open Tabs
- Open the Command Palette (
Ctrl+Shift+P
or Cmd+Shift+P
on macOS).
- Type
Merge Open Tabs
and select the command.
- A new tab will open with the merged content of all open text tabs.
Commands
The extension contributes the following commands:
extension.mergeSelectedFiles
: Merge selected files from the workspace.
extension.mergeOpenTabs
: Merge the contents of all open text tabs.
Development
Build
To build the extension, run:
npm run compile
Watch
To watch for changes and automatically compile, run:
npm run watch
Test
To run the tests, execute:
npm test
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
Special thanks to the VS Code team for their excellent API and documentation.
For more information, visit the Visual Studio Code documentation.