emoacht / TrimCopy

A Visual Studio extension to copy code block trimming leading white spaces while keeping indentation structure
https://marketplace.visualstudio.com/items?itemName=emoacht.TrimCopy
MIT License
4 stars 3 forks source link
trim visual-studio

# Trim Copy

Trim Copy is a Visual Studio extension to copy selected code block to the clipboard trimming leading white spaces while keeping indentation structure. It allows the user to copy the code in text editor of Visual Studio, trim unnecessary white spaces and paste it into a document in Markdown or other format by one step.

Requirements

If you have only installed older version of .NET Framework, use VSIX package which is built for .NET Framewrok 4.6.

Keyboard shortcuts

The keyboard shortcuts can be assigned by Visual Studio's options settings. See Identify and customize keyboard shortcuts in Visual Studio.

Open Options, go to Keyboard and find this extension's commands by searching TrimCopy in Show commands containing box.

Screenshot

Set shortcut keys as you wish.

Development

Each version of Microsoft.VisualStudio.SDK meta-package is compatible with corresponding version of Visual Studio.

Microsoft.VisualStudio.SDK Compatible Visual Studio
15.x 2017 (15.x), 2019 (16.x)
16.x 2019 (16.x)
17.x 2022 (17.x)

Thus each project is compatible with corresponding version of Visual Studio as shown below.

Product name Project name Microsoft.VisualStudio.SDK Compatible Visual Studio
Trim Copy 2019 TrimCopy.VSIX.2019 15.x 2017, 2019
Trim Copy 2022 TrimCopy.VSIX.2022 17.x 2022

Do not accidentally update Microsoft.VisualStudio.SDK of TrimCopy.VSIX.2019.

When updating project version, edit productId parameter of InstalledProductRegistration attribute of TrimCopyPackage class as well.

To run an extension in debug mode inside experimental instance of Visual Studio, the following settings are required in Debug pane of project properties.

These are default for Extensibility VSIX project and written in csproj.user file but that file is not included in the repository in principle.

History

Ver 2.4 2021-12-1

Ver 2.3 2021-11-23

Ver 2.2 2021-8-1

Ver 2.1 2019-12-15

Ver 2.0 2017-2-19

Ver 1.2 2016-5-28

Ver 1.1 2016-4-24

Ver 1.0 2016-1-6

License