[ESS] How does one use "!!", etc. to get command history

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 22 18:22:08 CEST 2006


>>>>> "StEgl" == Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk>
>>>>>     on Fri, 22 Sep 2006 16:19:18 +0100 writes:

    >> The documentation on the command history completion for ess indicates that
    >> you can use <meta> commands to go through the command history to find
    >> matches to some command, e.g.:
    >> 
    >> M-r (comint-previous-matching-input) 
    >> 
    >> It also discusses using a csh-like approach, eg. '!!' will go to prev
    >> command. 
    >> 
    >> However I can't figure out how to escape the interactive R window to enter
    >> these commands. 
    >> 

    StEgl> hi Marcus,

    StEgl> in an *R* window, try the following:

    >> 2 * 9 

    StEgl> (should print "[1] 18")

    StEgl> now at the > prompt type "!!" followed by space and then TAB; you
    StEgl> should then see "2 * 9 " with cursor after space.

    StEgl> This is in the manual:

    StEgl> For example, to execute the last command that referenced the variable
    StEgl> `data', type `!?data SPC TAB RET'.

Impressive! I had completely forgotten about these since ---
I have to admit --- I've never seen the need for any of
this, but maybe I have "wrong habits" ?

Instead of "!! SPC TAB"      "M-p" seems much faster and
instead of "!?data SPC TAB"  I'd use  "data <up>"
which is of course not as nicely hackerish and even uses a
non-hacker-keyboard key <up> {up-arrow key}; but then I did
decide 18 years ago to use emacs rather than vi  :-)

Martin




More information about the ESS-help mailing list