Re: [R] a simple trick to get autoclose parenthesis on windows

From: Jose Quesada <quesada_at_gmail.com>
Date: Sun, 31 May 2009 20:20:07 +0200

Gabor Grothendieck wrote:
> Hi, I was looking for your sendcodetoR.ahk autohotkey script
> but couldn't find it. Would you be able to point me to it.
> Thanks.
>

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
-- 
Jose Quesada, PhD.
Max Planck Institute,
Center for Adaptive Behavior and Cognition -ABC-, 
Lentzeallee 94, office 224, 14195 Berlin
http://www.josequesada.name/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 31 May 2009 - 18:24:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Sep 2009 - 15:00:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive