susam / devil

Emacs minor mode that intercepts and translates keystrokes to provide a modifier-free non-modal editing experience
https://susam.github.io/devil/
Other
169 stars 10 forks source link

How to type `C-c m`? #1

Closed rudolf-adamkovic closed 1 year ago

rudolf-adamkovic commented 1 year ago

I have tried <EVIL> c m but it does not work. Ideas?

P.S. ; is the choice for <EVIL> and should be the default.

susam commented 1 year ago

Hi @salutis,

Thank you for creating this issue. For typing something like C-c m, I use a configuration like this:

(setq devil-translations
      '(("%k z" . "C-")
        ("%k %k" . "%k")
        ("%k m m" . "M-")
        ("m z" . "M-")
        ("m m" . "m")
        ("%k" . "C-")
        ("m" . "M-")))

Assuming the devil-key is ; we now can type ; c m m to get C-c m. This configuration follows the existing general trend of double-typing the special character to get a single special character. Another trend this follows is using a z in between to prevent double-typed special character from becoming a single special character. Here are some translation examples with this configuration:

I have to admit though that I don't use the contrived z-based key sequences often. But they are there in case one needs them. I hope this helps. I might include the additional translations for m z and m m presented above in the default translation rules in a future release. I'll update this issue and post a comment here once that is done.

rudolf-adamkovic commented 1 year ago

@susam Thank you for taking the time to explain the problem, as well as, to provide a solution.

susam commented 1 year ago

The additional translation rules mentioned in my previous comment are now included in this package by default. They were added in commit fc62e58 and available in this package since version 0.4.0.