this post was submitted on 11 May 2024
571 points (100.0% liked)

Programmer Humor

24175 readers
1610 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 120 points 1 year ago (6 children)

Nevermind simply having an OS-level clipboard manager...

[–] [email protected] 67 points 1 year ago (3 children)

Win+V works decently enough for me.

[–] [email protected] 41 points 1 year ago (2 children)

Same for plasma, global clipboard is just more convenient

[–] [email protected] 13 points 1 year ago

Global clipboard is chef's kiss. Back when I was on Ubuntu/Gnome, I had to install CopyQ but having one come with the OS is great

load more comments (1 replies)
[–] [email protected] 10 points 1 year ago (3 children)

I think windows+v syncs to microsoft servers or something. I remember when I was running chris titus tech's debloat script it removed that functionality.

[–] [email protected] 10 points 1 year ago

I googled it, there is an option to sync it to your Microsoft account, but I can't say whether that's on by default when you turn on clipboard history because I skipped adding a Microsoft account. But if it is, you can turn it off in Settings -> System -> Clipboard.

[–] [email protected] 8 points 1 year ago

Holy crap I think that may be why I never used it. Fuck how much Windows likes to calls home

[–] [email protected] 5 points 1 year ago (1 children)

An excellent option to have when one of the major use cases for clipboards is as an intermediary for password managers.

I hope they eventually get sued into the fucking ground.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 18 points 1 year ago (4 children)

There is for windows, and it's further improved if you get power toys too

load more comments (4 replies)
[–] [email protected] 17 points 1 year ago (1 children)

Application specific buffers are the first thing I disable on emacs. The OS one isn't just integrated with every other normal piece of software, it's also more powerful and easier to use.

... at least on my Linux, YMMV.

[–] [email protected] 5 points 1 year ago

The os buffer is just another buffer that I can yank into.

[–] [email protected] 9 points 1 year ago (1 children)

Windows also has it, but it's disabled by default for some reason

load more comments (1 replies)
[–] [email protected] 5 points 1 year ago (2 children)
load more comments (2 replies)
load more comments (1 replies)
[–] [email protected] 40 points 1 year ago (3 children)

ive never had to think about clipboard buffers until i used a modal editor.

now i spend %60 of my time trying to figure out where the copied symbol went.

[–] [email protected] 8 points 1 year ago (2 children)

I don't have the name handy, but there's at least one plugin for vim that shows buffer previews in a popup. I've got it mapped to leader-sb (for "show buffer").

[–] [email protected] 4 points 1 year ago
load more comments (1 replies)
[–] [email protected] 7 points 1 year ago

You can see all registers in use with :registers, to paste from a register say "2 in insert mode use key combination <ctrl-r>2 or in normal mode "2p. You can check out more in :help registers. Unnamed register or "" is the system clipboard I think. To copy texts in a register you can prepend yank (/delete/cut, etc.) with that register "_ (for black hole register[^black_hole]) This is for neovim. Have keybinds for them and there saved you a plugin :D

[^black_hole]: Text yanked in this register is gone, i.e. it's not saved in any register.

[–] [email protected] 6 points 1 year ago

So far I haven't been brave enough for that feature. It's either "that main place yank goes", "system clipboard", or "that place that makes it disappear" for me

[–] [email protected] 38 points 1 year ago (2 children)

Gee, X11! How come your mom lets you have THREE clipboards?

[–] [email protected] 19 points 1 year ago

then theyre all ignored by x-clip

xD

[–] [email protected] 7 points 1 year ago (1 children)

Wait is that an actual thing?

[–] [email protected] 26 points 1 year ago* (last edited 1 year ago) (4 children)

Yes. X11 replaced X10's obsolete cut buffers (which can be modified by any process) with state-of-the-art selections. There are three selections in X11: a primary, a secondary, and a clipboard.

In modern desktops, the primary selection is overwritten every time you select some text (including in the terminal), which makes its content very ephemeral. You can paste it with the middle mouse button.

The secondary selection is generally not used, but it's present in the specification, and you can use xclip -selection secondary to access it. Wayland doesn't seem to have a secondary selection.

The clipboard selection is what most people understand to be THE clipboard. You have to write to it explicitly (through a keyboard shortcut, API, or CLI tool), and its content persists until it is overwritten, explicitly cleared, or the X server is killed. While the primary and secondary can only contain text, the clipboard can contain many kinds of data.

load more comments (4 replies)
[–] [email protected] 30 points 1 year ago (1 children)

Y'all haven't heard of Windows clipboard history? Windows + V will change your life, I tell ya!

[–] [email protected] 6 points 1 year ago (3 children)

Last I checked you have to enable it, which is annoying.

[–] [email protected] 14 points 1 year ago

You use it once, it asks if you want to enable, and you click literally one button.

[–] [email protected] 10 points 1 year ago (1 children)

Meanwhile, this was a feature on KDE-land since Klipper, which goes back (as far as I know and if I remember well) to KDE 3 or sooner.

[–] [email protected] 7 points 1 year ago (1 children)

There have been third party clipboard managers forever in windows, which is kind of funny because that is almost more like the unix philosophy than expecting the UI system to handle it all.

[–] [email protected] 4 points 1 year ago (1 children)

Klipper was entirely a different program, process, etc. that was using the system tray. Nowadays it seems to be a plasmoid in the system tray. How can that be less of a UNIX philosophy than the Windows alternative? Because it's developed by the same community that makes the shell? That doesn't make sense to me.

load more comments (1 replies)
[–] [email protected] 4 points 1 year ago (3 children)

To be fair it may be a security concern if someone is copy pasting passwords

[–] [email protected] 5 points 1 year ago

Keeping their admin password in the history so they don't have to alt+tab to their Secret Server webpage? W-who would do such a thing?!

load more comments (2 replies)
[–] [email protected] 25 points 1 year ago (2 children)

And I still don't really know how to use registers in vim 😂 I just use yy and paste 🥲

[–] [email protected] 29 points 1 year ago* (last edited 1 year ago) (3 children)

You just do " (listen for next character as register name)

Then, say q,w,e etc, then yy to yank as normal.

So "wyy

To retrieve it you use "wp

To add to it "Wyy

To view them :reg

Remember you can make "w anything, like "x or "p

And each time you yank it gets pushed into the default register history "0 "1 "2 etc

[–] [email protected] 6 points 1 year ago

I didn't know about registers, thank you for this!

load more comments (2 replies)
[–] [email protected] 5 points 1 year ago (1 children)

I only know how to use them with q. I hope that's a register, otherwise I will look foolish.

[–] [email protected] 4 points 1 year ago

They are. Registers are just "named boxes" where you can store some text and/or keystrokes. When yanking and pasting, the unnamed register is used if you don't specify a name (you can still see or edit it explicitly). For recording a macro there is no default register, though. You need to give it a name.

[–] [email protected] 21 points 1 year ago (1 children)

Same thing but reversed with multiple cursors :/

[–] [email protected] 8 points 1 year ago (6 children)

That's actually the biggest thing I miss about VSCode

[–] [email protected] 9 points 1 year ago (2 children)

https://github.com/mg979/vim-visual-multi

I also missed multiple courses, but I started using vim-visual-multi in my nvim config and it's been great. There's a few others I tried that I couldn't get to work quite right (usually some weird conflict with nvim-cmp) but I've had the best success with vim-visual-multi.

load more comments (2 replies)
[–] [email protected] 8 points 1 year ago (2 children)

helix has a pretty good mc system in the select mode.

[–] [email protected] 5 points 1 year ago (3 children)

search in selection is such a cool workflow

load more comments (3 replies)
load more comments (1 replies)
load more comments (4 replies)
[–] [email protected] 13 points 1 year ago (7 children)
[–] [email protected] 13 points 1 year ago* (last edited 1 year ago)

they have no use for copy buffers, they are still configuring emacs.

[–] [email protected] 9 points 1 year ago (2 children)

No, but I'm happy to talk to you about our lord and savior nano

load more comments (2 replies)
[–] [email protected] 7 points 1 year ago (1 children)

Obligatory boo and/or hiss

I've also been meaning to give emacs a try but haven't found the time or energy to figure out how to exit vim

load more comments (1 replies)
load more comments (4 replies)
[–] [email protected] 9 points 1 year ago (4 children)

Buffers are great. Comes very handy when creating macros in vim.

[–] [email protected] 5 points 1 year ago (1 children)

I think you mean registers not buffers. buffers are file(s) loaded in memory while registers contain text yanked/deleted/last command/last search, etc.

load more comments (1 replies)
load more comments (3 replies)
[–] [email protected] 6 points 1 year ago

Give CopyQ a try. Open source, cross platform clipboard manager with tons of features.

One example option is being able to only ever paste plain text. It also has lots of programming hooks, I have a few for doing things like converting a line-feed delimited list into one delimited by commas and quoting the values.

load more comments
view more: next ›