tmhglnd / mercury

A minimal and human-readable language and environment for the live coding of algorithmic electronic music.

Home Page:http://www.timohoogland.com/mercury-livecoding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide more actions for binding to keyboard shortcuts

marcora opened this issue · comments

It would be great to have more actions available for binding to keyboard shortcuts. Also, it would be nice to have a drop down to select among a few common keybinding schemes, e.g., Vim-like or Emacs/Bash-like.

For the latter, as an example, selecting the "Emacs/Bash-like" scheme from the dropdown would set the following actions to the following keyboard shortcuts:

CTRL+A / CTRL+E | Go to the start/end of the line
CTRL+U / CTRL+K | Delete from cursor to the start/end of the line
CTRL+W / ALT+D | Delete from cursor to start/end of word (whole word if at the boundary)
CTRL+X | Cut whole line and add to clipboard
CTRL+C | Copy whole line to clipboard
CTRL-V | Paste (insert) whole line from clipboard
CTRL-Y | Paste (replace) whole line from clipboard
CTRL+F / CTRL+B | Move forward/backward one character
META+F / META+B Move forward/backward one word (or go to start of word the cursor is currently on)
CTRL+D / CTRL+H | Delete character after/before under cursor
CTRL+N / CTRL+P | Move to next/previous line
CTRL+L | Delete everything

WIth META being Apple key on MacOS or Meta key on Windows/Linux

Given the similarities between Mercury and Sonic Pi, perhaps offering a similar scheme would help transitioning users from one system to the other.
Screen Shot 2021-01-31 at 13 13 28

Screen Shot 2021-01-31 at 13 12 18

commented

Thanks for this, I have not looked at all the keybinding options from Sonic Pi yet, also not sure if I want to have the same keybindings, but did include the option to jump words in the latest commit 07cf633 with alt-j and alt-l. But having the option to switch between different shortkey "presets" would be interesting to look at!

commented

Deleting characters (as opposite to backspace with delete key) is now included in 09f080c