Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Support registers for "yank" commands? #58

Open
ashiklom opened this issue Jan 11, 2019 · 0 comments
Open

Support registers for "yank" commands? #58

ashiklom opened this issue Jan 11, 2019 · 0 comments

Comments

@ashiklom
Copy link

It would be great to implement a version of the Magit "yank" functions that can be combined with evil registers. For example, I often want to copy the commit hash from Magit and paste it into a GitHub issue, Slack channel, etc. It would be really awesome to be able to do this with the keys "+ys (yank to system clipboard).

I think this would require wrapping the magit-yank-* in evil-define-command with register support, but I don't know evil's internals well enough to do it myself.

In the meantime, in case it's useful for others, I wrote the following helper function for copying the top of my kill ring to the system clipboard:

(setq select-enable-clipboard t)

(defun ans/kill-ring-to-clipboard ()
  "Copy current kill ring to system clipboard"
  (interactive)
  (gui-select-text (current-kill 0)))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant