The weight of the clipboard
kinduff.com
kinduff.com
I don’t know why I do it. It helps me think, though. Maybe any of the keys on the keyboard would satisfy my cravings to tap a key repeatedly, but I unconsciously chose capslock because it’s mostly benign to press. Perhaps it’s the toggling of the capslock state that tickles my neurons? I don’t know!
Similarly, I felt very strongly about the contents of my clipboard while doing any input on a real keyboard , until I discovered IntelliJ’s clipboard history feature (Ctrl+Shift+V) and more broadly Window’s terrible but sufficiently functional version (Win+V). The emotions I felt about clipboard contents were intense. I had to have something small, succinct, and simple in my clipboard like a single word, so that I could spam Ctrl+V and Ctrl+Z constantly without consequence, just like my capslock tic.
I do wonder if my fidgeting helped me learn editor shortcuts, because while I’m never quick enough to meet my own editing-speed goals, my editor fu earned me the title of “Text Wizard” at one company. It’s fun blowing peoples’ minds by smoothly executing a column-based edit on thousands of lines of data, saving them potentially hours of manual editing.
Aside: A coworker once called a one-line regex a “dark incantation,” and a forty-line regex I wrote on someone else’s’ PC earned the title of “Cthulhu’s Lullaby.” Good text editing skills is a superpower in our age (for many but obviously not all occupations).
Not everything needs to be the result of some implied mental health problem.
I just fidget. A lot. I have to concentrate to sit still (meetings are torture). When I'm thinking about a problem, my mental budget is redirected to problem solving, so my fidget inhibiting stops.
Drives a lot of people nuts. Whatever. Go sit somewhere else. I'm sitting over here, away from everyone, minding my own business. I didn't ask you to sit near me.
Everyone's different. Some people hum. Some people "talk aloud" (my kryptonite). Some people do zen flow state. I like to dance, so I put in the ear buds and jam.
- The system should be able to efficiently store, manipulate, and search an unlimited number of clipboard entries with reasonable performance.
- The software should be cross-platform, and should have implementations for major desktop platforms (Windows, X11, Wayland, macOS).
- Non-text data (images) and rich text (e.g. HTML) should be supported.
- Clipboard history can be shared across instances using a network connection.
- Instances may temporarily go offline, and sync up with other instances once a connection is re-established.
- - All functionality should continue to be available when offline (other than sync).
- Deletions must be propagated across instances.
- Deleted clips must not be trivially recoverable.
- Deleted clips must be deleted everywhere, including any copies in OS clipboards.
- Sync should be incremental (and otherwise generally efficient).
- When connected, actions should propagate across instances in real time (instantly, as opposed to polling, and with no unnecessary roundtrips).
- Relaying should be supported (in a `A <-> B <-> C` scheme, A should be able to see C's actions).
- Network topology cycles should not result in a feedback loop.
- It should be safe and easy to simply copy the database file to another host, "pre-seeding" the clipboard history.
- Support "portable installs" (carrying the software, configuration, and database on portable storage).
- It should be easy to write interoperable implementations of bridges/clients in most programming languages.
- Non-GUI functionality should be separated (or separatable) from GUI functionality, so that a GUI toolkit doesn't need to be loaded at all times.
Any suggestions?
For instance, in this mode you hit Ctrl+C five times, then the subsequent five Ctrl+V actions paste the data in FIFO order. It may not seem like much, but going in between app windows in order to grab data is a big time sink. Being able to copy items sequentially and then paste them sequentially would be a killer app in most Excel heavy office workflows. You could also add a toggle for LIFO, or maybe some keyboard shortcut / chording for toggling modes while the user is pasting.
I had actually tried to implement this as a hobby project but truthfully, my MVP was rudimentary at best because I’m inexperienced at COM+ and developing for the Windows Shell.
Edit: I’m using ‘Stack/Queue’ loosely, not in the rigid data structure term of art way.
Would this work, or is there more to it?
If I would guess, I would assume there is already one somewhere.
If there isn't maybe just using Syncthing would be enough?
Nobody needs yet another clipboard manager as there is almost a perfect one out there. Which can be extended by plugins! (I don't think it's a valid approach to start a new project because some project doing most of the wanted stuff isn't "perfect". The result is almost always "yet another 80% solution").
The "limited" number of entries is not an issue, imho. You can set it to x-thousand entries if you like. (One thousand entries are enough for more than two weeks of history for me. A clipboard is not a means of permanent data storage at all so this is fine; even one can have something akin to permanent entries by just using tabs in CopyQ).
Implementing in CopyQ some of the suggestions mentioned here would be great though!
You can read the issue I filed in CopyQ's repository back when I switched to Linux and had to stop using Ditto for the justifications of infinite history: https://github.com/hluk/CopyQ/issues/510
CopyQ is also bound to use Qt's clipboard implementation, which provides the common subset of Qt's supported platforms, with all the consequent limitations. See the other issues I filed for details.
In addition to: cut | copy | paste
Add: swap
It swaps the current selection with the contents of the clipboard (replacing the clipboard with the selection, replacing the section with the prior contents of the clipboard — a swap).
It's a nerdy ask, if anything adds more complexity to the clipboard concept. But I have found myself having a need for this shortcut often.
Maybe others have as well.
If I want to move things between them, I should open the clipboard manager and manually move an individual item, or bridge the two clipboards for a specified time, after which they go back to being isolated.
Is that sensible/practical?
When an application makes data available in the clipboard, it's a free-for-all for every other application. The clipboard manager would have to race other applications to make a copy of the data, and then empty the OS clipboard.
APIs also may not allow making decisions based on which application requested the clipboard. It's possible to do in X11, but not Windows.
This goal could be achievable by intercepting the OS clipboard API. On X11, this can be done by MITM-ing the connection to the X server - https://github.com/CyberShadow/hax11 does this, and already has one clipboard-related security feature (disabling the selection mechanism). On Windows, the best bet is probably global DLL injection and API hooks, but applications can "opt out" by running as a different user or requesting a higher integrity level.
All of my AutoHotKey triggers are off of the right control since I noticed a long time ago that I never use it regularly. In the old days (~2004) I would use it to write HTML. Hitting right Control+a for example would surround the text with an <a> and have logic for @ or http: etc - or hitting right Control+l would surround a list of items with <ol><li>. These days I have very few macros, the most useful one being code that will "type" what's on my clipboard rather than paste it which is useful for places that don't allow pasting.
>^v:: SendRaw %clipboard% Return
While there definitely are good use cases where rich text clipboard should be supported, for me personally a major use case requires eliminating rich text - where I'm frequently pasting some data from some web system into e.g. a word document and I want to explicitly paste just the text, because it really does not matter what styling the web page used for some ID. Word's "Paste Special"->"Unformatted text" is horribly inconvenient, so currently I just paste it in my text editor and re-copy it, ensuring that only the text remains in the clipboard.
Edit: I see Microsoft Word doesn't natively have that shortcut, but there are two ways to "implement" it here: https://superuser.com/questions/988527/how-can-i-use-ctrl-sh...
Removing rich text formats is a good idea for a clipboard manager feature/plugin, though.
I used to use PureText for this, but this morning I discovered CopyQ and now I'm enjoying its enhanced clipboard capabilities, including that feature.
Ability for keyboard-free editing, as in classical X: select to copy, click to paste.
The clipboard manager I used on Windows, which only works there and hasn't been supported for a while, allowed a "Win+V, type, enter" workflow to very easily search for whatever I "type"d as a substring, and paste that entry. No interacting with menus, no up/down presses, no mouse. I miss that feature.
- The system should be able to efficiently store, manipulate, and search an unlimited number of clipboard entries with reasonable performance.
- All functionality should continue to be available when offline (other than sync).
- The software should be cross-platform, and should have implementations for major desktop platforms (Windows, X11, Wayland, macOS).
- It should be safe and easy to simply copy the database file to another host, "pre-seeding" the clipboard history.
- It should be easy to write interoperable implementations of bridges/clients in most programming languages.
- Non-GUI functionality should be separated (or separatable) from GUI functionality, so that a GUI toolkit doesn't need to be loaded at all times.
But I'm not sure how to do this in SQLite as it probably does not fill deleted records with zero bits (but you could do that in your application):
- Deleted clips must not be trivially recoverable.
To make SQLite zero-out deleted pages, issue "PRAGMA secure_delete = on".
clip boards for different apps
regex to process entries
For example, I routinely copy-paste my passwords from KeePass, and I have disabled all clipboard management to avoid copies of my passwords lingering around.
edit: ah, nevermind, it's just not exposed to .NET, search for "CanIncludeInClipboardHistory" here: https://docs.microsoft.com/en-us/windows/win32/dataxchg/clip...
edit2: also some ideas to use the API from autohotkey for concerned people like me: https://www.autohotkey.com/boards/viewtopic.php?t=97251
Mmm, Windows Clipboard does saves the password that I copied from Keepass, they will be in the menu. However Keepass have a option to clear the last entry in the clipboard which is set for 10 second to let the password persist in the clipboard and then Keepass will overwrite/remove the last entry after the time is up. Very useful imo.
I copy/paste passwords much more often than I require multiple clipboard entries alive together.
Additionally you can configure apps to be ignored for the clipboard history feature.
Password managers are mostly intended to help facilitate unique passwords per account, to avoid password re-use which prevents credential stuffing. That is, if an attacker gets a hold of your password from one website they can't use it to log in everywhere.
Back to your concern, there isn't a solution for Windows in this space at the moment. Malware that's alive in your user context (or Satya forbid, SYSTEM) can do quite a bit thanks to Win32 APIs.
Autotype do not suffer this problem and is generally considered safer. Some password managers have an even safer "mixed" mode where part of the password is in the clipboard and another part is auto-typed, meaning you have to monitor both the keyboard and the clipboard to grab the password
(I'd prefer the clear/overwrite myself.)
Another option would be specific IPC such that clipped content is available to one and only one other application or process. There was a recent HN submission on the Unix password manager utility "pass", including the ability to supply passwords to a command via shell expansion rather than as a command-line parameter. The former doesn't reveal the password in either process listings or shell history, the latter does.
That's a relatively primitive option, a more robust standard might also be provided.
I wrote about it back in 2016 on my very ugly website: https://www.tidbitsfortechs.com/2016/02/clipboard-manager/
It was super easy to customise and once I'd setup shortcuts for everything, never needed to open the app window in 2+yrs
Ditto also rearranges the items so the last pasted is at the top rather than the last copied. This is also helpful because if I'm pasting something regularly, it's nice for it to be at or near the top.
You can configure how much history you want Ditto to store, by days or number of entries.
The Ditto clipboard entries are not as visually bulky as the Windows clipboard history entries.
The Ditto window can be resized, the Windows clipboard manager cannot be.
Those are the main reasons for me. Ditto also has a bunch of more advanced features but I've never used them.
Not only does it store a bunch of things but it's really easy to search through existing clips, especially text.
It's also:
- Extremely efficient from a runtime perspective, it uses ~2mb of memory
- Loads nearly instantly when you invoke it
- Very easy to paste something without formatting (surprisingly useful)
- Open source
It's in the same category of greatness as IrfanView and foobar2000 for Windows apps that I'll likely use until the end of time.The irrational part comes in when it's time for me to make the tweaks. Maybe I'm working on a yaml config file, and I need to specify two objects that are mostly the same, with minor changes to one of them.
I'll make sure I'm working on "the copy", and not "the original". So, let's say I start with this:
- author: E. Hemingway
title: The Old Man and the Sea
medium: hardcover
edition: 1
published: 1952
And the project manager says I need to add the second edition paperback to the list. I'll find that block, copy the whole thing, and *then make sure I don't disturb the "original": - author: E. Hemingway
title: The Old Man and the Sea
medium: hardcover
edition: 1
published: 1952
- author: E. Hemingway
title: The Old Man and the Sea
medium: trade
edition: 2
published: 1953
Basically, I've internalized that my bits have a color[1].So you have to arbitrarily choose one and keep in your mind that that's the one to be edited. You could choose the 'bottom' one. But because object persistence is pervasive, you choose the 'new' one.
Bits have a colour, sure, but they have a(t least one) history as well, and that at least can be reasoned about mathematically.
B) The habit seems very effective, why would you want to 'shake' a very efficient process?
C) DRY is an end-state which makes sense for (some) code. It is not at all clear that it makes sense for i.e. yaml config files, where it is expected that numerous items may have many similarities.
Sounds to me that by internalizing that bits are colored you have improved your engineering skills.
So in vim, I might yank an entire line and paste it immediately ("yyp"). This automatically pastes below the yanked line and positions the cursor on the new line. But let's say I want to make the edit above the existing. This situation is wrong. The new line was just pasted below the existing. Even though I'm looking at a pair of perfectly identical lines in the file, and could make my edit wherever I choose, I have this idea that one of those lines is the original and the other is the copy. And I don't want to edit the original. In other words, whether I "do it wrong" or "do it right", the end result will be bit-for-bit identical. But one of those edit paths bothers me and the other one doesn't.
So in the yanking and pasting process, I'll take the extra time to move my cursor above the copied line, then paste it in so as to preserve the "lineage" of the text.
This has nothing to do with version control or any other actual efficiencies. It's just my brain being weird. I don't gain any actual benefit, just a calm mind :)
C) Yeah, I was just heading off any nitpicks about my comment.
One of the key things I can't go without now in my workflow is a clipboard manager.
I use Rofi (https://github.com/davatorium/rofi) in combination with Greenclip (https://github.com/erebe/greenclip) and it's a Godsend.
I have a custom keybinding (super key + c) that will bring up the Rofi menu to fuzzy search through previously copied items or pinned items. Super handy when writing code, finding old snippets, etc.
Can't recommend it enough.
Well:
1/ copy URL from browser
2/ alt tab to vim notes
3/ delete old URL from notes
4/ paste new URL but get the old URL instead?!
How do I do the FORTH equivalent of swapping the two items on the top of the stack (and have a stack in the first place)? :)
I also really like junegunn/vim-peekaboo, which really helps if I know I copied something, but I'm not sure how far down the stack it is.
One solution I have in vim which I always forget to use is adding an additional d or p to use a secondary paste buffer:
vnoremap dd "ad
nnoremap ddd "add
nnoremap pp "ap
:[range]m[ove] {address}
Some common remaps: vnoremap <c-j> :m '>+1<CR>gv=gv
vnoremap <c-k> :m '<-2<CR>gv=gv
inoremap <c-j> <Esc>:m .+1<CR>==gi
inoremap <c-k> <Esc>:m .-2<CR>==gi
nnoremap <leader>j :m .+1<CR>==
nnoremap <leader>k :m .-2<CR>==To paste the copied URL instead of the deleted one, you can paste from the 0 register by using "0p.
Otherwise, depending on your system, pasting from the * or + registers (using "*p or "+p) will paste what you copied from the browser.
Having the common deletion operation also default to adding to clipboard is a design mistake in Vim, I feel.
This works even if I ssh into something.
It’s one capability I sometimes miss on my i(Pad)OS devices.
[0] https://obdev.at/products/launchbar/index.html [1] https://hluk.github.io/CopyQ/
The other thing that has bothered me all these years:
Head down and typing,
Whoops, no text field selected.
Where did the text go?
Now a new feeling haunts me.
I must paste it, MUST.
Into the app I confidently paste.
It's bold italic and a funky font!
Why does this always blow up in my face?
He designed a whole user interaction paradigm to solve it, so that the system would always be in a state where your typed text would be registered, right there.
It goes well with the aphorism and commandment that "user input is sacred", which all current user interfaces disregard big time.
Burden of summer's first ant
Paste it, light once more.
Even if I would lose something, it wouldn't take too much time to restore it. If its a password - 99% of them can be recovered
I feel limited without a clipboard manager now.
It tracks your last N items, shows previews of images, has search, clean UI, does not store items from 1Password (ignored app list is editable)
Ticks all the boxes
Not to me, because in the software I use the thing gets actually deleted once I paste it somewhere else, not before. It's more like tagging the thing(s) for moving to a location to be disclosed later.
I always use cut (+ immediately paste back if needed) rather than copy because it gives me the visual confirmation that the object has indeed been put in the buffer.
It is also very useful, but if you don't want it many clipboard managers have a simple checkbox to just have one clipboard.
For instance "synchronize clipboard" in this screenshot: https://www.putorius.net/wp-content/uploads/2019/12/gpaste-g...
I often have to copy X and Y coordinates from two fields to the same fields in another instance of the application. Is there an easy way to copy both values and only then switch to the other instance and paste them?
Otherwise this is up to the app. A generic clipboard has no concept of the content of X and Y being in different fields (because it has no clue what a "field" is). It just stores the content.
Or with primary selection: select X and press ctrl+c, select Y; ctrl+v to insert X, middle-click to insert Y.
From a quick look over the website I see no feature to prefer it over included standard clipboard managers like klipper, glipper, parcellite,... (or any from https://wiki.archlinux.org/title/Clipboard#Managers) and whatever win+V on windows is called.
I currently have 1 & 2 sync'd ok, but 3 is only one-way. I use the OSC 52 escape sequence (supported by my terminal) to sync a copy on 3 to 1. But I have not figured out how to sync from 1 to 3.
When I yank to the "kakoune clipboard buffer" in kakoune (a terminal text editor), the X clipboard is updated (again through OSC 52). When I copy something to the X clipboard (either on chrome or some other program), the "kakoune clipboard buffer" is updated [0].
[0]: technically, the kakoune clipboard buffer updates itself from the X clipboard when it is read from.
john crowley's little big is sort of about this
you may as well keep your passwords in a plaintext file.
If anything, replies here should suggest the missing word
I would say it's the Zeigarnik effect
https://en.wikipedia.org/wiki/Zeigarnik_effect
I find Clipboard managers remove this. Since putting it into the queue is a whole task.
Very similar to when you remember something that you want to write down before you forget it again.