[racket] Key Shortcuts

401 views
Skip to first unread message

Sayth Renshaw

unread,
Jan 2, 2011, 7:49:28 AM1/2/11
to us...@racket-lang.org
Are there any key shortcuts in racket to comment and uncomment a block of code? Also at the prompt is there a keystroke to bring up last typed entry same as command prompt?

Cheers

Sayth

Robby Findler

unread,
Jan 2, 2011, 7:54:59 AM1/2/11
to Sayth Renshaw, us...@racket-lang.org
On Sun, Jan 2, 2011 at 6:49 AM, Sayth Renshaw <flebbe...@gmail.com> wrote:
> Are there any key shortcuts in racket to comment and uncomment a block of
> code?

These ones, at least, are in the Racket menu (and so have shortcuts).

> Also at the prompt is there a keystroke to bring up last typed entry
> same as command prompt?

esc-p. Also, depending on your platform, there may be others.

Check out the Edit|Keybindings submenu.

Robb
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users

Miguel Villaverde

unread,
Jan 2, 2011, 12:42:04 PM1/2/11
to us...@racket-lang.org

-----Mensaje original-----
De: users-...@racket-lang.org [mailto:users-...@racket-lang.org] En
nombre de Robby Findler
Enviado el: domingo, 02 de enero de 2011 13:55

<<
On Sun, Jan 2, 2011 at 6:49 AM, Sayth Renshaw <flebbe...@gmail.com>
wrote:
> Are there any key shortcuts in racket to comment and uncomment a block of
> code?

These ones, at least, are in the Racket menu (and so have shortcuts).
>>

Are you sure? I don't see them. I'm using the Windows version of DrRacket
and the only commands that have keybindings under the Racket menu are Run,
Ask the Program to Quit, Force the Program to Quit and Reindent All.

I can't find them either in the Edit|Keybindings submenu.

This is something that has bugged me for a while, since I'm working my way
through HTDP and commenting code in and out is something that I do a lot of.
Perhaps those keybindings were left out of the Windows build for some
reason?

Thanks,
Miguel

Robby Findler

unread,
Jan 2, 2011, 4:48:44 PM1/2/11
to Miguel Villaverde, us...@racket-lang.org
On Sun, Jan 2, 2011 at 11:42 AM, Miguel Villaverde
<mvill...@gmail.com> wrote:
> On Sun, Jan 2, 2011 at 6:49 AM, Sayth Renshaw <flebbe...@gmail.com>
> wrote:
>> Are there any key shortcuts in racket to comment and uncomment a block of
>> code?
>
> These ones, at least, are in the Racket menu (and so have shortcuts).
>>>
>
> Are you sure? I don't see them. I'm using the Windows version of DrRacket
> and the only commands that have keybindings under the Racket menu are Run,
> Ask the Program to Quit, Force the Program to Quit and Reindent All.

Try alt-c and then c for comment out and alt-c u for uncomment.

Robby

Greg Hendershott

unread,
Jan 3, 2011, 10:30:11 AM1/3/11
to Miguel Villaverde, us...@racket-lang.org, Robby Findler
In other words there aren't shortcut keys ("accelerators") per se
bound to these commands. But you can use the keyboard to choose an
item from a menu, as usual in Windows. (This is the one biggest thing
I miss when I'm using OS X. (No, pressing C+F2 arrow arrow arrow arrow
... isn't the same :) )).

So ALT+C opens the Ra_c_ket menu and C (or ALT+C is fine if you still
have the ALT key held down) chooses the _C_omment Out with Semicolons
command.

Stephen Chang

unread,
Jan 3, 2011, 12:55:02 PM1/3/11
to Greg Hendershott, flebbe...@gmail.com, us...@racket-lang.org, Robby Findler
In Windows,

esc-ctrl-; comments

and

esc-ctrl-= uncomments

This is for emacs keybindings mode. I dont know if it works when emacs
keybindings are off.

Miguel Villaverde

unread,
Jan 5, 2011, 11:41:07 AM1/5/11
to Greg Hendershott, us...@racket-lang.org, Robby Findler
-----Mensaje original-----
De: Greg Hendershott [mailto:greghen...@gmail.com]
Enviado el: lunes, 03 de enero de 2011 16:30

<<
In other words there aren't shortcut keys ("accelerators") per se
bound to these commands. But you can use the keyboard to choose an
item from a menu, as usual in Windows. (This is the one biggest thing
I miss when I'm using OS X. (No, pressing C+F2 arrow arrow arrow arrow
... isn't the same :) )).

So ALT+C opens the Ra_c_ket menu and C (or ALT+C is fine if you still
have the ALT key held down) chooses the _C_omment Out with Semicolons
command.
>>

Yeah, I got that, thanks. :)

At any rate, I find it a bit surprising that there aren't any "proper"
shortcuts for this in DrRacket. There's a bazillion of them under Active
Keybindings, and I doubt all of them are more useful or frequently used than
the act of commenting/uncommenting code. But then I'm not a professional
programmer, so what do I know.

On a loosely related note, are there any plans of implementing a vi-mode for
DrRacket? I've never actually used vi, mind you, but I've always been
intrigued by its "do everything with the keyboard without so much as looking
at it" philosophy. Having it in DrRacket might entice me to actually try it.

I hope the Emacs crowd won't be terribly offended by this suggestion. :)

Miguel

Reply all
Reply to author
Forward
0 new messages