0

When use Emacs For Mac OS X, copy a string from browser(E.g. B) then paste into it, it works.

But if use ciw(vim mode) on a string(it's the same as copy a string inside the tool, E.g. A), then Ctrl + v to paste the previous string again, it will show the one cut in the tool(A). I hope it can take B here.

This case doesn't happened when use emacs in terminal.

2
  • Can you elaborate a bit more on the steps you are taking, e.g. do you copy a string when in vim mode? Also, what is the behaviour you would like to see? Commented Aug 26, 2021 at 8:16
  • @Lindydancer I added some more description. E. g. B and A. It seems A overwrite B(from outside) in the GUI tool.
    – Miantian
    Commented Aug 26, 2021 at 8:57

1 Answer 1

1

I'll try to guess what you mean ;-) and suggest using M-x yank-pop (bound by default to M-y normally) instead of M-x yank (bound to s-v and C-y by default in my setup on Mac OS, but possibly Ctrl + v is bound to yank in your case).

The exact behavior of the yank-pop may depend on the version of Emacs you're using (this function was updated not so long ago). You can read more about this command usage in installed Emacs with C-h f yank-pop and M-x info-apropos <RET> yank-pop.

On Emacs 28.0.50, after hitting M-y (M-x yank-pop) I currently get this nicely looking kills (cuts) history selection interface in the minibuffer: enter image description here

[Use C-s and C-r to switch to the next/previous item.]

Another way to use M-x yank-pop is to call it right after pasting with the M-x yank command (s-v/C-y binding), such as:

  1. C-y inserts the most recent item from the kill ring.
  2. Then M-y replaces just inserted item with the earlier available killed item (going further back in the kill history on each M-y hit).

Hope my guess is right and this answer helps you.

2
  • Thank you! Your guess is right and it's very helpful to me.
    – Miantian
    Commented Aug 27, 2021 at 23:22
  • @Miantian, I'm glad to hear it.
    – Y. E.
    Commented Aug 28, 2021 at 8:04

Your Answer

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

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