paste-as-markdown-codeblock
is a Visual Studio Code extension that allows you to paste selected code or text as a Markdown code block.
-
Paste the copied code as a Markdown code block using
Ctrl+Alt+V
-
Press
Ctrl+Space
to enter a language identifier (e.g.,JavaScript
,Python
,TypeScript
). -
Right-click in the editor and select "Paste as Markdown CodeBlock" to use the command from the context menu.
No special requirements or dependencies are needed.
- Visual Studio Code version 1.xx or later
This extension provides the following settings:
-
pasteAsMarkdownCodeblock.defaultLanguage
Specifies the default language identifier used when pasting a code block.
Default:"plaintext"
-
pasteAsMarkdownCodeblock.languages
Defines a list of language identifiers available for selection. You can customize this list to include only the languages you frequently use.
Default:
[
"plaintext",
"javascript",
"typescript",
"python",
"cpp",
"java",
"bash",
"html",
"css",
"json"
]
These settings can be configured from the Settings UI or by editing your settings.json
file directly.
Press Ctrl+Alt+V
to paste the copied code as a Markdown code block (only when the editor is focused).
-
The language name may not always be correctly inserted, depending on the input.
-
The command requires selected or copied text. If nothing is provided, no output will be generated.
- Initial release
- Added functionality to paste selected text as a Markdown code block
This extension follows the official VS Code extension development guidelines.
This extension is licensed under the MIT License.
Thanks for using this extension!
Feel free to report bugs or request features via the Issues page.