Re:Vim 9.0
by theposey on Thursday June 30, 2022 @05:17PM
(#31938734)
can't you just yank to +? you might need the vim build with +clipboard if it's not default these days
[ Parent
| on HN ]
I have vim use the clipboard by default, with that said I still use the mouse to copy stuff now and then.
Depending on your OS, you could use visual line mode and highlight the text you want to copy. Then you can run:
'<,'>w !xclip -selection clipboard
to copy the text to your clipboard. Macs have another program that works similar to xclip, but I don't remember what it's called.> Macs have another program that works similar to xclip, but I don't remember what it's called.
pbcopy
While I'm here, on Wayland substitute wl-copy (or whatever you use).
What's the advantage of this command over "+y ?
If vim doesn't have clipboard support enabled, then this is one way to copy and paste. The vim packages in the Fedora repositories are configured such that vim doesn't have clipboard support, but gvim does.
Not GP, but for me it's simply that I remember it (or rather don't need to, because it's just using general purpose mechanisms that I already remember).
But now you've said it maybe I'll remember if I need it today, and.. well I'll see.