Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to disable copy with syntax highlighting #21820

Closed
daviwil opened this issue Mar 2, 2017 · 18 comments
Closed

Add setting to disable copy with syntax highlighting #21820

daviwil opened this issue Mar 2, 2017 · 18 comments
Assignees
Labels
editor-clipboard Editor clipboard issues feature-request Request for new features or functionality

Comments

@daviwil
Copy link
Contributor

daviwil commented Mar 2, 2017

  • VSCode Version: 1.10.1
  • OS Version: Windows 10

There doesn't seem to be a way to turn off the default behavior of copy/pasting with syntax highlighting. Some users may have a workflow where they want to paste text into an external rich edit text box (like a web form) without the extra formatting but there doesn't seem to be a way to turn this off right now.

/cc @rebornix @RamblingCookieMonster

@yfdyh000
Copy link
Contributor

Duplicate of #21071.

@rebornix rebornix added the editor-clipboard Editor clipboard issues label Jun 7, 2017
@jamesfancy
Copy link

jamesfancy commented Sep 3, 2017

There are two actions in VSCode:

  • editor.action.clipboardCopyAction
  • edtior.action.clipboardCopyWithSyntaxHighlightingAction

We can bind one of them to Ctrl+C. So that if clipbordCopyAction does copy without formatting, everything would be okay.

@melipharo
Copy link

It seems that this does not works on 1.18.0. I've set those variables in "keybindings.json":
{ "key": "ctrl+shift+alt+c", "command": "editor.action.clipboardCopyWithSyntaxHighlightingAction" }, { "key": "ctrl+c", "command": "editor.action.clipboardCopyAction" }
but when I'm hitting Ctrl+C and pasting the clipboard in the rich edit (such as web form or a word/excel), I've got the highlighted text instead of just the text only. The ctrl+shift+alt+c does the same thing as the Ctrl+C.

@tatoosh
Copy link

tatoosh commented Jan 25, 2018

How to get it working to copy without format?

1 similar comment
@AlGantori
Copy link

How to get it working to copy without format?

@ioma8
Copy link

ioma8 commented Apr 10, 2018

Hello, please how do I set copy to not pick up formatting???

@xan1000
Copy link

xan1000 commented May 16, 2018

In case anyone else comes here - I still haven't found an answer to this outside work arounds, e.g., pasting the clipboard into a plain-text file and copying it again. I made an extension called "CopyPlainText" as a less annoying work around which adds a command palette for this.

@tatoosh
Copy link

tatoosh commented May 16, 2018

Thx @xan1000 - ur extension is working well for me

@ioma8
Copy link

ioma8 commented May 16, 2018

Thx for creating extension for this @xan1000 , I will check it.

@melipharo
Copy link

@xan1000 wow thx a lot! It just works.

@rsyring
Copy link

rsyring commented Aug 22, 2018

I'd just like to point out that I really think this is a bug with respect to the default behavior of VS Code. Right now, we have two commands:

  1. Copy: editor.action.clipboardCopyAction (CTRL + C default binding)
  2. Copy with Syntax Highlighting: edtior.action.clipboardCopyWithSyntaxHighlightingAction

To me, that would imply that the plain "Copy" is copy without syntax highlighting. But that doesn't seem to be the case.

@ioma8
Copy link

ioma8 commented Aug 22, 2018

Yes this is bug and needs attention!

@linhtto
Copy link

linhtto commented Aug 29, 2018

This shouldn't be hard to fix, so I hope it'll happen soon!

@ioma8
Copy link

ioma8 commented Aug 29, 2018 via email

@rebornix
Copy link
Member

rebornix commented Sep 5, 2018

With this great PR #54155, we can now disable the copy with syntax highlighting behavior by setting editor.copyWithSyntaxHighlighting to false from tomorrow's Insiders and next Stable. Command "Copy With Syntax Highlighting" would always work not matter of the value of this setting, so you can bind another specific keybinding for this command.

Lastly thanks for all your patience, feedback and great contribution to this issue. Happy Coding!

@rebornix rebornix closed this as completed Sep 5, 2018
@ioma8
Copy link

ioma8 commented Sep 6, 2018

Thanks a lot guys for fixing this!! Rly appreciate this.

@danvoyce
Copy link

Not working for me in 1.27.2

@rebornix
Copy link
Member

@danvoyce it will work with next Stable version 1.28. For now you need to use Insiders version.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-clipboard Editor clipboard issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests