Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, thank you so much for Boon. I have been using it for about a year. I have a great love for it.
This code adds an ACMD alternate command state, 3 alt keymaps, and a global var to toggle between the default set and the alternate set. This is my fix for wanting to switch between Qwerty and Dvorak mappings seamlessly. The changes also automatically put you in CMD / SPC / ACMD (alternate command) automatically whenever you switch to a buffer. this will clobber your INS buffers, which is actually by preference, but that's besides the point.
I don't necessarily think this is a best solution to my problem nor fit for general use, I just wanted to share some code, share the problem I was facing, and start a discussion. Maybe there is a code contribution somewhere here but that's not up to me :)
As alternatives before doing this, I tried adjusting the keymaps after boon-mode is initialized. But I had some issues. Ex in qwerty c calls boon-c-god but in Dvorak I wanted it to be previous-line. When I deleted "c" from boon-command-map and then mapped "c" in boon-moves-map, I would get "c" is undefined. I didn't look into the root cause of this :) It seemed like the alist of maps which power boon-local-mode was getting out of sync with the keymap vars, but I'm not sure why.
I also tried making it easy to restart emacs with desktop.el. This did work but it was not seamless. There is some friction to switch as I would have to change my config using the wrong keymaps, then restart emacs. I usually got mixed up too, I would restart emacs without change the config the first time and have to try again. And desktop.el I found a bit tricky to use as well.
Here is my current config which lets me call simple
M-x boon-toggle-alt
to switch between Qwerty and Dvorak.