Snippet CopyEver wanted to copy part of a source file as a snippet and paste it somewhere else, like in Slack or in a GitHub comment? Previously, you either got a bunch of unnecessary indentation that made the snippet ugly to read or you had to manually un-tab the snippet, copy, and then reset the indentation. With Snippet Copy you can automatically get a snippet added to your clipboard with all the leading indentation already removed! InstallationGet the extension from the marketplace or manually search for it in VS Code. The unique identifier is FeaturesAll features can be used via different ways in VS Code
Copy SnippetSimply get a copy of your currently selected code or text snippet added to your clipboard – without any leading indentation that you would otherwise need to remove manually. Copy Snippet as Markdown Code BlockCopies the currently selected snippet without leading indentation and automatically wraps it in a fenced Markdown code block. OptionsInclude Language IdentifierThe "Copy Snippet as Markdown Code Block" command can optionally include the current VS Code document's language identifier in the Markdown code block. Including a language identifier enables syntax highlighting in some places (like in Issue or Pull Request comments on GitHub) but is incompatible with other tools, such as Slack. This behavior can be controlled through a configuration setting:
Possible options are:
Convert Tabs to SpacesMany tools or websites often render tabs very widely or generally in a weird way and make therefore them not very pleasant to look at. Snippet Copy therefore by default automatically converts a tab character to two spaces. This can be adjusted in settings:
With an icon lovingly crafted by @dipree 🌺 |