Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider easier to type default keybindings for cargo actions #491

Open
grothesque opened this issue Feb 10, 2023 · 1 comment
Open

Comments

@grothesque
Copy link

The default keybindings for running cargo actions are

  • C-c C-c C-u rust-compile
  • C-c C-c C-k rust-check
  • C-c C-c C-r rust-run
  • C-c C-c C-t rust-test
  • C-c C-c C-l rust-run-clippy

When touch-typing, these are quite difficult to type, requiring first using one Ctrl-key and then the other.

While it is common among Emacs modes to use C-c C-c for "finishing" or "building" something, I am not aware of a tradition of continuing with C-<letter> after the prefix. Nor seems there to be such a necessity, since any key binding after the C-c C-c prefix is still free.

How about redefining the above such that a simple letter chooses the action, for example:

  • C-c C-c u rust-compile (although one may ask why "u" for compile/build)
  • C-c C-c k rust-check
  • C-c C-c r rust-run
  • C-c C-c t rust-test
  • C-c C-c l rust-run-clippy

I am aware that anyone may redefine keybindings, and this is what I did. I am signalling this here because I believe that a good default configuration is valuable.

@appetrosyan
Copy link

There’s a chapter in Jeremy Friesen’s “Mastering Emacs” that specifically explains why holding the key is considered a good thing. Specifically in relation as to why numerical aeguments are input with any modifier.

I would specifically mention that if you are typing with two hands, your proposed keybindings will actually be harder to execute, because one has to release the ctrl key before typing the final letter. In the recommended setup, you hold down control for the entire sequence.

So I’m not sure it’s a good idea to replace the current bindings, but maybe supplement them.

Given your particular complaint I would recommend god-mode, because that should help you out even more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants