alexmurray / evil-vimish-fold

63 stars 5 forks source link

Proper way to override zk binding? #14

Closed zzantares closed 7 years ago

zzantares commented 7 years ago

Hello there! So far enjoying the package however I have an issue, not necessarily with the package but with the jumping mappings zk and zj.

I don't use the qwerty layout and I'd rather prefer having zk for evil-vimish-fold/next-fold and zh for evil-vimish-fold/previous-fold. I'm trying to override the mappings but isn't working:

(use-package evil-vimish-fold
  :ensure t
  :after vimish-fold
  :config
  (evil-vimish-fold-mode 1)
  :general
  (:keymaps '(normal motion)
            "zh" 'evil-vimish-fold/previous-fold
            "zk" 'evil-vimish-fold/next-fold))

I've already tried with evil-define-key instead of general but I can't make it work. Can you give me a hand with this?

Thanks for any help!

alexmurray commented 7 years ago

What if you set them in evil-vimish-fold-map instead - perhaps give the following a try:

:config (progn 
           (evil-define-key 'normal evil-vimish-fold-map "zh" 'evil-vimish-fold/previous-fold)
           (evil-define-key 'normal evil-vimish-fold-map "zk" 'evil-vimish-fold/next-fold))
zzantares commented 7 years ago

Yes! That works!

Thanks for the help @alexmurray!

alexmurray commented 7 years ago

You're welcome