Skip to content

a simple trick to get autoclose parenthesis on windows

2 messages · Jose Quesada, Gabor Grothendieck

#
Gabor Grothendieck wrote:
Here's what I have right now, it also maps right alt to send code to R.
You should change the ahk_class to your editor of choice (here it's
vim). To get the ahk_class, you need to run the atoit_spy (comes with
every autohotkey install).

HTH,
-Jose

; F3 and right alt will send selection to open Rgui
#WinActivateForce
    F3::
    IfWinExist, ahk_class Rgui
    {
        Send ^c                    ; copy selection to clipboard
        WinActivate ; R Console
        save = %clipboard%
        sendinput, {Raw}%save%
        sendinput,{enter}
        Sleep 1000
        WinActivate, ahk_class Vim
    }

    Ralt::
    IfWinExist, ahk_class Rgui
    {
        Send ^c                    ; copy selection to clipboard
            WinActivate ; R Console
            save = %clipboard%
            sendinput, {Raw}%save%
            sendinput,{enter}
        Sleep 1000
            WinActivate, ahk_class Vim
    }
return
#
Thanks very much.  Regards.
On Sun, May 31, 2009 at 2:20 PM, Jose Quesada <quesada at gmail.com> wrote: