corgi-emacs / corgi

Unbundled Emacs configuration aimed at Clojure developers
180 stars 18 forks source link

Corkey how do I define only insert mode commands? #11

Closed oxalorg closed 2 years ago

oxalorg commented 3 years ago

I want to replicate this behaviour in corkey

(evil-define-key 'insert 'global
  (kbd "9") "("
  (kbd "0") ")"
  (kbd "(") "9"
  (kbd ")") "0")

I have tried the following:

(normal|visual ...)
(insert
 ("0" "Open bracket" ")"))

and

(normal|visual ...
  (insert
   ("0" "remap" ")")))

But both didn't work.

Maybe

;; = 'normal' | 'insert' | 'visual' | 'emacs' | 'motion'

state should have an empty value for the topmost form, so that others can be nested inside it

eg:

(""
  (normal|visual ...)
  (insert
   ("0" "remap" ")"))))
oxalorg commented 2 years ago

Looks like this commit should fix it: https://github.com/lambdaisland/corgi-packages/commit/58ba47e2de5453d50cfd0fbe6a77f2ab5c7fb132