microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.28k stars 6.55k forks source link

Advanced Paste - Implement EMACS style kill-ring #33038

Open wcwong opened 5 months ago

wcwong commented 5 months ago

Description of the new feature / enhancement

EMACS kill-rings allow you to access your clipboard history with multiple invocations of the paste command.

While you can get the same functionality now, this feature means that I can do it with one keyboard shortcut rather than having to navigate a menu to select the item i want to paste.

Scenario when this would be used?

This would allow me to quickly paste in data from clipboard history with few keystrokes.

Supporting information

No response

joadoumie commented 5 months ago

This seems interesting -- can you provide specific example / images of the flow and how it works for you today?

/needinfo

wcwong commented 4 months ago

I believe there is already an idea of a clipboard history.

so lets say I make three copies into the clipboard in this order.

copy 1 has a value of "c1"; copy 2 has a value of "c2"; copy 3 has a value of "c3".

if I do the typical CTRL-V, it would paste in the most recent entry into the clipboard (c3).

with kill-ring support, if I hit ALT-V (for example), it would paste in "c3". If I hit ALT-V again, it would remove the "c3" paste and instead put in "c2". If I hit ALT-V yet again, then "c2" is replaced with "c1".

A common use case is often I want to remove a piece of code and move it somewhere else. However, the 'somewhere else' has something I want to remove. By having the kill ring support, I can cut the code I want to copy, then remove the code I want to replace, and then paste in the code I originally copied. Doing this all via the keyboard rather than menu items and mouse movements make things more efficient.

wcwong commented 4 months ago

This video also seems to show it in action https://youtu.be/LFXA089Tx38?t=202

joadoumie commented 4 months ago

Ok got it -- this is a cool idea with a clear use-case. I'm going to remove the needs-triage here. Thanks for the feedback. Great idea.