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

Only assume "C-"-prefix for the first part of a command sequence #73

Open
mattiasb opened this issue Apr 7, 2015 · 9 comments
Open

Comments

@mattiasb
Copy link

mattiasb commented Apr 7, 2015

Most keybindings I use (standard and nonstandard) are in the following form:
C-c₁ c₂ c₃ c₄ …
That is, only the first part of the command demands me holding down Ctrl.

I would love to be able to tell god-mode to skip Ctrl (like it does now) but only for the first part of a command sequence and then instead force me to actually use Ctrl (or space?) in the few places where Ctrl is needed for more than the first part of a sequence.

Or by example:

Current god-mode

rectangle-kill: x SPC r SPC k
split-window-below: x SPC 2
insert-register: x SPC r SPC i
find-file: xf
save-buffer: xs

god-mode with my proposed setting

rectangle-kill: xrk
split-window-below: x2
insert-register: xri
find-file: x C-f or x SPC f
save-buffer: x C-s or x SPC s

I understand that find-file and save-buffer are very common commands, but you can easily swap those two with set-fill-column and save-some-buffers with a modified keybinding. My experience tells me that the number of keybindings I'd want to change would be fewer this way (meaning less configuration).

Hope this makes sense, and thanks for a cool project!

@chrisdone
Copy link
Contributor

Correction:

Current god-mode

rectangle-kill: x SPC rk
split-window-below: x2
insert-register: x SPC ri
find-file: xf
save-buffer: xs

IME commands that require SPC are rare by comparison to the vast number of basic commands that are C-a C-b. Are you sure this would be a real benefit?

@chrisdone
Copy link
Contributor

(See here for the split-window-below: https://github.com/chrisdone/god-mode#nice-keybindings)

@mattiasb
Copy link
Author

We must just be using different commands a lot. :)
C-x C-s and C-x C-f are the only ones I use that I can immediately think of that are on the C-a C-b-form.

And yeah I know about that split-window keybinding. And it sure make sense to rebind a few commands to fit with god-mode but for me that would be almost all commands I use on a daily basis. What I'd do if god-mode worked like I'm suggesting is to just rebind save-buffer and find-file and then be done with it.

@snan
Copy link

snan commented Nov 24, 2016

I agree with Chris re this. I use a lot of C-i C-j C-k stuff. And, since I've been using god mode for a while, my new commands also usually are in that form.

But, more importantly: how would you distinguish between a sequence of separate C- commands vs one C-initiated command sequence? For example C-e C-t C-b C-m (go to end of line, switch the two characters, go to beginning of line, insert new line) in god mode now is just etbm.

@mattiasb
Copy link
Author

mattiasb commented Nov 25, 2016

I also use a lot of commands like C-e, C-a and C-SPC etc. And under my proposal those commands would work just like now. That is C-e C-t C-b C-m would still just be etbm.

But I also do a bunch of C-x r k, C-x 4 f and C-x ( etc. where current god-mode gives me (respectively): x SPC r SPC k, x SPC 4 SPC f and x SPC (. I would love to just type xrk, x4f and x( instead. :)

I have no idea about the technical implications of this. A while after I posted this issue I switched to control-mode instead which largely solves this issue for me (while at the same time feeling a bit more hacky :/ ).

Anyways, I'm personally totally fine with just closing this issue. If I decide to work on this I can always fork. :)

@trev-dev
Copy link

I would like to draw some attention to meow. Their keypad mode is very similar to god-mode, only it infers the next key-bind. You only need to be explicit with conflicting key-binds.

I think it's a feature god-mode can benefit from.

https://github.com/meow-edit/meow/blob/master/meow-keypad.el#L366

@DogLooksGood
Copy link

Meow borrowed this idea from a fork of god-mode. But there's also some bugs involved, so I forked and had a fix.
https://github.com/DogLooksGood/god-mode

@snan
Copy link

snan commented Nov 11, 2022

But I also do a bunch of C-x r k, C-x 4 f and C-x ( etc. where current god-mode gives me (respectively): x SPC r SPC k, x SPC 4 SPC f and x SPC (. I would love to just type xrk, x4f and x( instead. :)

I want xrk to be C-x C-r C-k and x r to be C-x r

@snan
Copy link

snan commented Nov 11, 2023

Someone on #emacs told me about "devil-mode" which might be more what you want, @mattiasb. This difference is actually why I decided to stay with god-mode.

One thing I've been wondering is… in message-mode there's C-c RET C-e. I know that in god-mode, that works by typing c SPC RET C-e, and also I mapped C-c C-RET C-e to it so c RET e works great, but I wonder how to do the originsl sequence without a control key, i.e. how to "get back to control" after a space. Maybe it'd be fun if the space was a toggle so that foo SPC bar SPC baz would be C-f C-o C-o b a r C-b C-a C-z. Although maybe that's not idempotent enough and it should be something other than space to go in that direction.

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

No branches or pull requests

6 participants