Is there a paste-replace shortcut?

3

Hello all :) This is be a petty request, but it is like an itch to me right now for a specific project:

There are shorcuts for copy and paste, but I often find myself moving bits of text between each other in circles. What I do is paste next to what I want to replace (buffer step), and then copy it.

I'm wondering if I can avoid the buffer step make this a one shot operation. Is there a shortcut somewhere that enables me to select text and have it go in the clipboard when I paste over it?

My OS windows, but the question is valid or all OSes, all plugins that could provide this.

Best regards

BenoitParis

Posted 2013-05-14T15:02:28.607

Reputation: 257

1

Someone asked a similar question about doing this in Visual Studio. There's no native support but someone linked to an AutoHotkey script to do the swap.

– User5910 – 2013-05-14T16:00:34.023

Answers

0

Here you have AutoHotKey script for that:

^CapsLock:: ;work with clipboard: swap clipboard and selection
    ClipboardOld := ClipboardAll
    Clipboard =     ;empty the clipboard so ClipWait statement can wait until it is filled
    Send ^c
    ClipWait, , 1
    ClipboardNew := ClipboardAll
    Clipboard := ClipboardOld
    ClipboardOld =  ;free the memory in case the clipboard was very large
    Sleep 250   ;wait until Clipboard is updated
    Send ^v
    Sleep 250   ;wait until Paste operation is completed
    Clipboard := ClipboardNew
    ClipboardNew =  ;free the memory in case the clipboard was very large
    Return
  • The hotkey is Ctrl+CapsLock but you can change it to anything else.
    I am using Win+Ctrl+X (dentoed as ^#x which is Ctrl+Win+x)

miroxlav

Posted 2013-05-14T15:02:28.607

Reputation: 9 376