F3:: WinGet vimWinID, ID, A ; save current window ID to return here later IfWinExist,R Console { Send ^c ; copy selection to clipboard WinActivate ; ahk_class RGui WinGet WinRID, ID, A Send ^v } Sleep 30 WinActivate ahk_id %vimWinID% Return F4:: WinGet vimWinID, ID, A ; save current window ID to return here later IfWinExist,RBT { Send ^c ; copy selection to clipboard WinActivate ; ahk_class RGui WinGet WinRID, ID, A CoordMode Mouse, Screen MouseGetPos, MouseX, MouseY CoordMode Mouse, Relative Click right 40, 60 Click up right CoordMode Mouse, Screen MouseMove, %MouseX%, %MouseY% } Sleep 30 WinActivate ahk_id %vimWinID% Return