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

keybindings to cut/copy/paste to/from clipboard #103

Closed
lordlabakdas opened this issue Apr 25, 2016 · 12 comments
Closed

keybindings to cut/copy/paste to/from clipboard #103

lordlabakdas opened this issue Apr 25, 2016 · 12 comments

Comments

@lordlabakdas
Copy link

Is there a keybinding for clipboard pastes from external sources such as the browser....atomic-emacs supports local cut/copy paste using regular emacs keybindings but not able to paste stuff from outside (without using the right click mouse->paste)

The way Emacs seems to handle it is through M-x clipboard-yank and M-x clipboard-kill-region.

@lordlabakdas
Copy link
Author

update: am able to copy text from atom to outside, and have updated the title to reflect this. The issue is with copying text from external sources to atom buffer.

@oggy
Copy link
Collaborator

oggy commented Apr 28, 2016

Which OS are you on? What do you see in the key binding resolver (cmd-. on mac) when you use the standard OS paste key (e.g. cmd-v on mac)?

@lordlabakdas
Copy link
Author

Ubuntu 14.04
On the key binding resolver and pressing Ctrl-v, the first 2 rows I see are
image

@oggy
Copy link
Collaborator

oggy commented Jun 18, 2016

Sorry for the slow response here.

That explains it, though: the problem is that emacs' ctrl-v (scroll-up) conflicts with what you'd expect of a regular Linux desktop app (paste). I just tested with Emacs on Ubuntu (16.04), and it too favors scroll-up for ctrl-v, so I'm inclined to keep this behavior, at least as the default.

If you're just after direct a substitute for M-x clipboard-yank, you can do alt-x core:paste.

If you want to permanently override ctrl-v to the Atom default, you can add this to your personal keymap:

'atom-text-editor:not(.autocomplete-active):not(.mini)':
  'ctrl-v': 'core:paste'

@MartyGentillon
Copy link
Contributor

In my experience, in current versions of Emacs, when I cut or copy something in another program, it is inserted at the top of the kill ring, so C-y pastes it. The kill ring here needs to work the same way.

@ghost
Copy link

ghost commented Sep 2, 2016

I agree with @MartyGentillon
Even when I start emacs with emacs -Q it integrates with system clipboard and I can copy and paste text from other apps to emacs (and vice vesa) seamlessly.

@oggy please consider adding this feature to atomic-emacs

@MartyGentillon
Copy link
Contributor

Tomorrow I should have a pull request for this.

MartyGentillon added a commit to MartyGentillon/atomic-emacs that referenced this issue Apr 21, 2017
Now, if the clipboard integration is enabled, the kill
rings will be updated with the contents of the system clipboard
before every yank or kill.

see avendael#103
@MartyGentillon
Copy link
Contributor

An initial implementation #130. There are a couple concerns: first, when yanking to multiple cursors, a multi-line system clipboard should be split between the cursors based on lines. (The current behavior is similar to my complaint in sublime-emacs/sublemacspro#176) Second, I am not certain that the "kill-ring per cursor" design is good. It might be better to have one unified kill ring that is aware of multiple cursors, and multiple cursor yanks.

oggy pushed a commit that referenced this issue May 15, 2017
Now, if the clipboard integration is enabled, the kill
rings will be updated with the contents of the system clipboard
before every yank or kill.

see #103
@MartyGentillon
Copy link
Contributor

So, the basic feature is now available. Todos include possibly rethinking the kill-ring-per-cursor feature such that cuts from other programs integrate the way they would with the normal cut / paste feature (specifically where if you paste two lines of text with two cursors, each line goes to one cursor.)

@oggy
Copy link
Collaborator

oggy commented Jul 28, 2017

Closing this, as the requested functionality is there now - thanks @MartyGentillon .

@oggy oggy closed this as completed Jul 28, 2017
@dostrander
Copy link

Just found atomic-emacs from this issue. Thanks for having a fix for one of my biggest complaints of atom.

@ifq
Copy link

ifq commented Mar 29, 2022

Hi,
I'm using version 0.15 right now, and the external copy doesn't insert into the kill ring. Am I missing something?

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

No branches or pull requests

5 participants