hlissner / evil-snipe

2-char searching ala vim-sneak & vim-seek, for evil-mode
MIT License
336 stars 25 forks source link

added a defvar to allow overrides of evil-snipe-repeat and evil-snipe-repeat-reverse #65

Closed joefromct closed 4 years ago

joefromct commented 4 years ago

Hi,

What I'd like to do with this is allow an override for evil-snipe-repeat and evil-snipe-repeat-reverse... reason being is ; specifically is tuff to get to on a dvorak layout.

As discussed (off topic accidentally) towards the end of #46 .

Apologies if this isn't the correct way to do this, i haven't contributed to any elisp projects before... let me know if this isn't your preferred way of doing this... please let me know what you think.

hlissner commented 4 years ago

The evil-snipe-override-evil-repeat-keys is provided for cases like these:

(setq evil-snipe-override-evil-repeat-keys nil)
(evil-define-key* 'motion evil-snipe-override-local-mode-map
  "..." #'evil-snipe-repeat
  "..." #'evil-snipe-repeat-reverse)

Since it is reasonably trivial to do without, I'd rather it be done this way than to introduce new variables for every use-case.

Hope that helps!

joefromct commented 4 years ago

as always, thanks for your help.

this is what i ended up with:

(use-package evil-snipe
  :init (progn
          (setq evil-snipe-override-evil-repeat-keys nil)
          (setq evil-snipe-parent-transient-map
                (let ((map (make-sparse-keymap)))
                  (define-key map "." #'evil-snipe-repeat)
                  (define-key map "," #'evil-snipe-repeat-reverse)
                  map))))