evil-string-inflection icon indicating copy to clipboard operation
evil-string-inflection copied to clipboard

Package binding hides a useful evil binding

Open ambihelical opened this issue 7 years ago • 7 comments

The binding for g~ defined by evil (evil-invert-case) is actually useful. I bind evil-operator-string-inflection to g- which is a great mnemonic, easier to type and currently unused in evil. However g~ is still lost unless I rebind it. Consider a different binding or making the default binding optional.

ambihelical avatar Aug 17 '18 16:08 ambihelical

interesting. g~ should not be lost if you rebind it. let me try to reproduce it.

ninrod avatar Aug 17 '18 16:08 ninrod

Yes, absolutely. I can rebind it, but I think the package should make it easier to avoid having to do this.

ambihelical avatar Aug 17 '18 18:08 ambihelical

Well, this should be easy, but apparently I cannot make it work because I'm horrible at elisp.

So I've posted a question in SO.

If this questions gets answered, or if somehow I find the solution, I'll quickly fix it.

ninrod avatar Aug 17 '18 19:08 ninrod

I am for sure no better an elisp programmer. But I think you should be able to make a defcustom for the key, with default value of "g~", or (kbd "g~") if you want and then pass that variable to define-key. I don't think kbd is really needed except for some kinds of key definitions, but I am not sure.

ambihelical avatar Aug 18 '18 19:08 ambihelical

I tested with this code, which works. Emacs 26.1:

(defcustom evil-test-key  "g~"
  "Key for a test text object."
  :type 'string)

(setq evil-test-key "g~")
(define-key evil-normal-state-map (kbd evil-test-key) 'evil-operator-eval)

VanLaser avatar Sep 10 '18 22:09 VanLaser

I ran into this today as well. I also use the defailt g~ for invert case.

abeluck avatar Jul 09 '19 10:07 abeluck

@VanLaser, you are doing a rebind on the client config, yes?

ninrod avatar Jul 09 '19 14:07 ninrod