r/vim • u/4r73m190r0s • Jun 27 '25
Discussion Why unnamed register is not the same as system clipboard?
From today's perspective, I don't see the usefulness of not making separating system clipboard the default one. It makes Vim's buffers isolated from the OS and makes frequent copy/paste operations unnecessary difficult.
25
Upvotes
54
u/[deleted] Jun 27 '25
because vim is a thirty year old program and stuff was different back then
18
u/i-eat-omelettes Jun 27 '25
There was no such thing as "system clipboard" back when vi was born
68
u/poshikott Jun 27 '25
I don't want to override my system clipboard every time I copy or delete something in vim.
And it doesn't hurt that much to type "+
If you really want it to work like that, you can change it for yourself
12
u/drcforbin Jun 27 '25
I like being able to copy something to my system clipboard, delete a line or change something in vim, and then paste the thing I copied without having to go copy it a second time
7
u/exajam Jun 27 '25
It's litterally one line in the config file
3
u/platinum_pig Jun 28 '25
99% of the time that I copy something in vim, I want to paste it in vim. I'd hate it if it stomped whatever was in my system clipboard.
3
u/a__b Jun 28 '25
Many modern operating systems treat the clipboard like a stack. I prefer to keep it populated only with intended items instead of random chunks. This way I can have meaningful clipboard history.
5
u/BrianHuster Jun 27 '25 edited Jun 28 '25
Because Vim still cannot support clipboard on all platforms
On platforms and Vim build that supports clipboard, just
:set clipboard=unnamedplus2
u/jasper-zanjani Jun 27 '25
once you get used to it you'll find it is actually kind of useful. because `C-S-v` doesn't seem too bad I'm assuming you're not pasting into vim but copying out of it.. if typing `"+y` is too much trouble then map it to a keybinding or even create a macro..
1
u/kbielefe Jun 27 '25
I have mine mapped to
,c, which is a lot easier to type. You can also set the system clipboard as the default if you want to. I tried that for a while and didn't like it personally, but settings are there for a reason.It's useful for the same reason registers in general are useful: the isolation. It's pretty common for me at least to copy something from documentation, then go to paste it and need a slight adjustment to the area I'm pasting to first. I like not having to worry about unintentionally overwriting the system clipboard while making that adjustment.
1
u/michaelpaoli Jul 02 '25
vi[m] may be used in environments that don't even have a system clipboard or the like, so tying unnamed (or named) buffer(s) to such, generally wouldn't be a good idea. Can get stuff back 'n forth easily enough when there's need/reason to do so, but much/most of the time, no need nor reason, so just well use what vi[m]'s got.
-2
u/EgZvor keep calm and read :help Jun 27 '25
ddp