Improving DrRacket ergonomics

Heya there! So I've been casually looking at the Racket ecosystem for a year or so, and due to recent circumstances I'm now planning to do HtDP, just so I can tick it off from my todo list and see if there's something I can learn from it. That means that I'm gonna have to do some DrRacket, for better or worse.

So far, I've written a bit of Racket and Rhombus code on my own, and I noticed the editor is a bit stuck in the 2000s. Here's the first few things I have observed:

  • Can't wrap text blocks in parentheses. In e.g. VSCode or GNOME Text Editor, you can select a block of text, then type (, and parentheses are inserted at the ends of the selection. Instead, the code gets replaced entirely.
  • Can't move code lines. Nowadays it is common to have Alt-{↑,↓} as keybindings for moving lines up and down. There's seemingly no such option nor equivalent on DrRacket, only cut and paste.
  • No multiple cursors. Just. Multiple cursors. Please.

Are there any DrRacket plugins that address these issues? Maybe some other interesting ones*? Thanks in advance!

*so far I only got drracket-cmdline-args

P.S.: off-topic, but the Spanish government and LaLiga are currently censoring the Racket websites. Again. Is there any odds we can get something that doesn't rely on Cloudflare, perhaps there's other Spaniards around who'd like to meet up and complain?

2 Likes

The Alt-{↑,↓} for moving lines would nice to have as default.

I think, the two first suggestions can be implemented with QuickScript.

There are examples of QuickScripts in QuickScript Extra:

There is more than I remembered!

It sounds as if this one [1]:

  • sections: Surrounds the selected text by comments ASCII frames

Could be modified to fit your wrap in parens bullet.

The multiple cursors idea probably need a helping hand from Robby.

[1]

1 Like

The list of things I'd like to change in DrRacket is too vast to enumerate here, but there are some that should be pretty easy. I'd like to have a set of hotkeys that can mimic some popular editor, be it emacs, vim, Visual Studio, VS Code, notepad++, etc. This would be a mode alongside the current default. There's currently a setting to make it behave more like emacs, but there seemed to be a lot of functionality missing and I didn't find it helpful.

Some specific wishes:

  • Repeat/resume current/previous search (F3 on windows, Ctrl-s on emacs)
    DrRacket will repeat the current search if you press Enter. But if you press any other key, Enter goes back to inserting newlines. F3 on windows will resume the previous search.

  • Comment and uncomment selected text (Ctrl-k Ctrl-c and Ctrl-k Ctrl-u on Visual Studio)

  • The circles and lines DrRacket draws over the text make it really hard for me to read what's underneath. It would be nice if I could dismiss them by pressing Esc.

  • Search for selected word. In a lot of editors, you can select a word and then press the search hotkey and automatically search for that word.

1 Like

If you didn't see this thread, this is helpful:

Also this: