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

p doesn't paste from system clipboard #166

Closed
pfmoore opened this issue Feb 8, 2017 · 18 comments · Fixed by #260
Closed

p doesn't paste from system clipboard #166

pfmoore opened this issue Feb 8, 2017 · 18 comments · Fixed by #260
Labels

Comments

@pfmoore
Copy link

pfmoore commented Feb 8, 2017

The p command doesn't paste from the system clipboard, and there's no equivalent of Vim's set clipboard=unnamed.

How do I paste text I have copied from another application? And can this be made the behaviour of the p command, either via an option or by default, as it's crucial to me for the "feel" of Vim integrated with Windows.

@aioutecism
Copy link
Owner

@pfmoore
System clipboard is not supported now. You can use the original shortcut (Ctrl+C/V), or if you have the amVim.bindCtrlCommands turned on, you could assign custom keybindings like this:

{ "key": "ctrl+shift+c", "command": "editor.action.clipboardCopyAction", "when": "editorTextFocus" },
{ "key": "ctrl+shift+v", "command": "editor.action.clipboardPasteAction", "when": "editorTextFocus && !editorReadonly" },

@pfmoore
Copy link
Author

pfmoore commented Feb 10, 2017

OK, thanks. Is there any timescale for system clipboard support?

@aioutecism
Copy link
Owner

@pfmoore
Sorry, this is a subproject so I can't promise anything.
However, system clipboard support has high priority and will be added in next few versions.

@pfmoore
Copy link
Author

pfmoore commented Feb 12, 2017

No problem - I appreciate all the work you've put into the project, I'm not trying to push at all :-)

@zhangbowei
Copy link

I'm here waiting for this...

@theSoenke
Copy link

Is there any update on this? System clipboard support would be really great

@aioutecism
Copy link
Owner

@theSoenke
I'll find time to work on this. Please wait for a little more.

@theSoenke
Copy link

@aioutecism Thank you!

@jleclanche
Copy link

@aioutecism Any updates on this? If you don't have time to work on it, I can give it a shot if you give me some pointers where to start :)

@karlhorky
Copy link
Contributor

Bump @aioutecism just ran into this today, would be cool to have @jleclanche help out on implementation!

@aioutecism
Copy link
Owner

@karlhorky Thanks for the bump! I’m not sure if jleclanche can still help since the comment is 8 months ago. I’m happy to provide instructions if anyone can help the implementation.

@karlhorky
Copy link
Contributor

In #17 (comment) I've found some potential keybindings for yank and delete actions, but the paste keybinding I tried isn't quite working yet!

@karlhorky
Copy link
Contributor

@aioutecism can you post the instructions for pasting and copying (#17) from the system clipboard here? I may have some time to take a look at this soon.

@karlhorky
Copy link
Contributor

The version that you wrote about in your 2016 comment in #17 (comment) would also probably be acceptable to most people who want this feature:

I can let y to make a selection then copy to clipboard, but this will make selections "blink".

Could be a default-off setting, if you think it would be too distracting for those not interested in this feature.

@aioutecism
Copy link
Owner

aioutecism commented Jan 18, 2020

@karlhorky VSCode now has an API to access system clipboard so this should be pretty easy to implement.

The ActionRegister class is handling copy/paste actions. We need to replace some logic to use system clipboard.

And I think we should add a default-off setting for it, and/or provide extra key bindings.

@karlhorky
Copy link
Contributor

Oh great! I'll see if I can find some time in the next days to take a shot at implementing!

@karlhorky
Copy link
Contributor

My first shot at a pull request up at #260.

@karlhorky
Copy link
Contributor

karlhorky commented May 31, 2020

Done in master (#260 was merged)! Will be released soon.

#272 contains documentation of the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants