0

When using neovim on macOS (at least macOS), text that is selected isn't automatically added to the primary selection for the operating system. One must use the terminal's selection utilities, or yank the text to the clipboard. I am unable to find a setting that will, upon selection update, add the selection to the primary selection. Is this possible?

Updated to add that this is not unique to neovim. I just tested, and the behavior is the same in vim.

0

1 Answer 1

0

I don't think macOS exposes "PRIMARY" (as distinct from "CLIPBOARD") in the way that other that, say, X does. See :help quoteplus and :help quotestar. In practice I find both registers are the clipboard on macOS, so I use * even though that's "wrong."

2
  • There is some notion of selected text not yet copied to the clipboard. kAXSelectedTextRangeAttribute allows some applications, like Raycast for example, to act on selected text without it ever being on the clipboard. And I can do it in my terminal just not in Neovim as far as I can tell. I think because that selection belongs to the containing emulator.
    – theherk
    Commented Apr 30 at 8:07
  • Not sure about "containing emulator," but it sounds like you could propose taking advantage of kAX… to the mailing list?
    – D. Ben Knoble
    Commented Apr 30 at 21:29

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.