11

In Visual Studio Code version 1.10 Copy with syntax highlighting has been introduced.

I don't want to use it most of the time but I can't find a way to turn it off. Even though I have no keybinding set for editor.action.clipboardCopyWithSyntaxHighlightingAction VSCode always copies with Syntax highlighting.

How can I turn it off so that I copy plain text only?

1
  • 1
    I don't think you can. From an issues page : "we put both plain text and html in clipboard and it's the target application who decides which format to paste." So it comes down to how you paste/paste Special etc. that determines whether you get plain text or source formatting. github.com/Microsoft/vscode/issues/3518
    – Mark
    Jun 9, 2017 at 22:09

2 Answers 2

21

Go to settings.json file and add

"editor.copyWithSyntaxHighlighting":false

https://github.com/microsoft/vscode/issues/20837

3
  • This setting does not work as expected. I just tried copying an attribute value from an xml file open in Visual Studio Code. The attribute is styled as bold format and in a blue color. With this setting active, both the bold format and the blue color remains when copying the text to word. When I disable the feature the bold format still remains. That is not the expected behavior.
    – j5423951
    Mar 1, 2021 at 9:18
  • This worked perfectly! Thanks Nov 17, 2021 at 6:50
  • Indeed, VSCode is different...but this answer gave me what I needed to fix my VSCode frustration, regardless.. Nov 21 at 16:32
-1

Using Visual Studio 2019, go to Tools/Options/Text Editor/Advanced then 'Copy rich text on copy/cut' to save color when cutting code from VS and pasting into Word.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.