Copy Text In Solution Explorer
You can copy the contents of the selected files in Solution Explorer to the clipboard.
The selected files are saved to the clipboard as headers and codeblocks in markdown. This is useful for easy pasting into GPT and querying.
Features
- Copy Single File: Right-click a file in the Explorer panel and choose "Copy Text Selected Files" to copy its contents to the clipboard.
- Copy Multiple Files: Select multiple files, right-click on one, and select "Copy Text Selected Files" to copy their contents. Each content is preceded by its file name and path.
- Copy Directory Contents: Right-click on a directory and choose "Copy Text Selected Files" to copy the contents of all files within, including subdirectories.
Usage
In Visual Studio, go to the Explorer view, select one or more files or a directory, right-click, and select "Copy Text Selected Files".
Example
Consider you have the following files:
index.html
<!DOCTYPE html>
<html lang="en">
...
</html>
src\global.scss
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
Selecting both files and using the "Copy Text Selected Files" command, the clipboard will contain:
### index.html
```html
<!DOCTYPE html>
<html lang="en">
<body>
<h1>hello world</h1>
</body>
</html>
```
### src\global.scss
```scss
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
```