Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy as Fenced Code BlockNew to Visual Studio Code? Get it now.
Copy as Fenced Code Block

Copy as Fenced Code Block

hikagami0210

|
3 installs
| (0) | Free
Copy selected code or the active file as a fenced markdown code block (with file path) to the clipboard
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy as Fenced Code Block

Copy selected code or an entire file to the clipboard as a fenced Markdown code block, with the file path in the fence header — ready to paste into chat, docs, or issues.

```ts:src/utils/helper.ts
export function helper() {
  // ...
}
```

Features

  • Select code in the editor, right-click → "Copy as Code Block" Copies only the selected text, fenced with the language and the file's path relative to the workspace.
  • Right-click a tab's filename → "Copy File as Code Block" Copies the entire file's contents, fenced the same way.

Both commands work identically in VS Code and Cursor.

Requirements

None.

Release Notes

See CHANGELOG.md.

License

MIT

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