xahlee / xah-fly-keys

the most efficient keybinding for emacs
http://xahlee.info/emacs/misc/xah-fly-keys.html
470 stars 80 forks source link

Integration mechanism for other major modes #97

Closed wi11dey closed 4 years ago

wi11dey commented 4 years ago

I've come up with a nice way to integrate both a mode's existing keymaps with xfk that helps me, sending a PR so other people can also benefit:

The xah-fly-one-command function basically enables insert-mode for the duration of one command, then re-enables command mode at the end of the function. I like to bind it to DEL in command-mode, so it's basically like all the old mode bindings are accessible thru the leader key DEL.

For example, Magit's "c c" to commit -> "DEL c c" in command-mode. Useful for things like Magit and PDF Tools. Other users can choose to bind it to something else like a function key in command-mode

xahlee commented 4 years ago

not sure about this. seems to me, it adds one complexity to the whole system and doesn't do much. also, it requires a easy key spot for this to have reasonable power but keyspots are already rare. For example, a keyspot can be used as a leader key to invoke current major mode commands, always. (my forward del key does this. but i also need to custom change major mode keys, so there's no C-c C-key stuff.)

wi11dey commented 4 years ago

Hm ok makes sense. I'll move this to my personal config then