Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Concat FilesNew to Visual Studio Code? Get it now.
Concat Files

Concat Files

TECHTILE media

|
7 installs
| (0) | Free
Concatenate selected files and copy combined output to the clipboard
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Concat Files — VS Code extension

Concatenate selected files and copy the combined output to the clipboard. Each file is wrapped with simple markers that show the original path.

Quick summary

  • Command: Concat Files (command id: extension.concatFiles)
  • Command: Clipboard → Files (Write blocks to disk) (command id: extension.clipboardToFiles)
  • Activation: on startup and when the command is invoked

Features

  • Concatenate one or more files and copy the result to the system clipboard
  • Files are annotated with start/end markers that include a path relative to the workspace root (or absolute if outside a workspace)
  • Skips non-file resources and shows warnings for files that cannot be read

Usage

  1. In Explorer, select one or more files, right-click and choose "Concat Files".
  2. Or open the Command Palette (Ctrl+Shift+P) and run "Concat Files".
  3. The combined text is copied to your clipboard. Paste where needed.

Clipboard → Files (reverse operation)

If you have text with blocks like this in your clipboard:

// ::: ./foo/bar.md
hello
// ::: end ./foo/bar.md

// ::: ./foo/qux.md
hello again
// ::: end ./foo/qux.md

Run the command "Clipboard → Files (Write blocks to disk)" from the Command Palette or the Explorer context menu. The extension will:

  • Parse each block between matching start/end markers.
  • Resolve the path (relative to your workspace for ./... labels, absolute paths are supported too).
  • Create parent directories as needed.
  • Write the block content to the target file (overwriting existing content).

You'll be asked to confirm before writing, with a short preview list.

Development

Install dependencies and build the extension:

npm install
npm run build

The build produces the compiled output under out/ (the extension entry point is out/main.js).

Package & publish

This repository includes npm scripts to package and publish with vsce.

Package a .vsix locally:

npx vsce package

Publish to the Visual Studio Marketplace using a Personal Access Token (PAT):

Recommended interactive flow (safer):

npx vsce login <publisher>
# paste the token when prompted
npx vsce publish

Or, use a local token file without printing it to the console (example that reads .personal-access-token):

$token = Get-Content -Raw -Path .personal-access-token
npx vsce publish -p $token

Important: Keep the PAT secret. Do not commit it. This repo already contains a .gitignore entry to exclude .personal-access-token.

Versioning

  • Increment the version field in package.json before publishing. The Marketplace requires a new semver for each release. You can use npm version patch to bump the version and create a git tag.

Troubleshooting

  • If publishing fails with authentication errors, confirm the publisher field in package.json matches the publisher you registered on the Marketplace and that the PAT has publish permissions.
  • If packaging fails, run the build and verify out/main.js exists.

Next steps I can take for you

  • Build and package a .vsix locally.
  • Publish to the Marketplace using the token in .personal-access-token (I will read it locally and not print it).
  • Remove any accidentally committed token from git history and help rotate it.

Tell me which of the next steps you'd like me to run now.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft