Calva: Simpler eval command hotkeys

Created on 18 Nov 2019  路  6Comments  路  Source: BetterThanTomorrow/calva

Do people think it might be simpler to evaluate code with a simple hotkey like CMD + Enter (on macOS)? This seems consistent with how online REPLs evaluate expressions and might be a bit easier for newcomers to Clojure than the Emacs-like bindings currently setup.

Examples:
https://repl.it/
https://coderpad.io/demo

question

All 6 comments

Hello! Thanks for raising this question.

Not sure if you mean the REPL prompt or in the editor? Seems like you might refer to the editor, since at the REPL eval is either ENTER or ALT+ENTER, depending on where the cursor is.

I just made some tests and some variations of modifier+ENTER are available. As well as modifier+SPACE. Food for thought!

I also find default keybindings a little bit hard to use. That鈥檚 why I rebound eval current form to cmd e + cmd e, and eval in repl to cmd e + cmd r. For me it was a huge usability improvement. Maybe someone will find it useful.

Yes, I meant in editor. What I've been doing is using the master command prompt (CMD + Shift + P) searching for Eval current form, then just using the master prompt repeatedly since it defaults to most recently used. But CMD + ENTER seems pretty natural based on those web editors/REPL simulators.

It is a little tough to avoid command chords and not interfere with existing VS code or other extension shortcuts. Still, evaluate inline and evaluate to repl are something I use a lot so it would be nice to use a simpler command. CMD + Enter is a VS Code command to insert line below, but maybe another combination like CTRL + CMD + Enter and CTRL + CMD + ALT + Enter would be a good replacement. Those don't seem to have an existing binding.

Since we now have alt+enter for evaluating top level and ctrl+enter for current form. Does that cover this issue, or are there other eval commands that we also should simplify?

Awesome progress! Closing ticket.

Was this page helpful?
0 / 5 - 0 ratings