Open mentalisttraceur opened 4 weeks ago
Я тут немного подумал... maybe the best way to do the keymap stuff is:
A sparse keymap where all Russian letters are bound to the corresponding QWERTY letters/symbols. Theb compose this map into global-map
(slash whichever other maps turn out to need it). This would cover approximately all situations, only breaking regular text insertion.
A sparse keymap with just all Russian letters bound to self-insert-command
- compose this map into Evil's insert state and emacs state maps to fix text insertion.
For "compose this map into", c.f. how make-composed-keymap
makes composed keymaps.
I haven't tried this yet, but as soon as I have reason to improve on what I have above, this is probably my next move.
Just sharing this in case it helps anyone. I started doing this at the end of my config:
https://github.com/mentalisttraceur/home/blob/b87838a23700d52cfd45aec8e3870daa4b55084f/.emacs.el#L5127-L5215
In particular, it's possible you'd prefer this approach for ex command aliases, and maybe it suggests a satisfying way to handle #1 .
Basically this defines a mapping from QWERTY to ЙЦУКЕН and then:
For every ex command which has English letters, it generates a mapped equivalent.
For every specified keymap, keybindings are added for Russian letters (and the
№
symbol since that's a straightforward mapping to#
.)There's automatic recursion into keymaps within the given keymaps.
It does have some weaknesses:
It works really well for me for now, although I've only just started using it.