hlissner / evil-snipe

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

Configure Evil-Sneak for F as in Clever-F? #1

Closed ReneFroger closed 9 years ago

ReneFroger commented 9 years ago

Thanks for sharing this plugin!

Although your plugin works for me, I would like to have same thing as Clever-F. I wonder if it's possible to emulate same behaviour as in Clever-F?

hlissner commented 9 years ago

I like the idea, and I have a plan for pulling it off. I'll let you know!

ReneFroger commented 9 years ago

Great, I'll be curious then!

hlissner commented 9 years ago

Alright, it's been implemented. Repeating is bound to ; and , at the moment, but you can change it to s/S with:

(setq evil-snipe-active-mode-map (make-sparse-map))   ;; only use this line if you want to remove ;/, 

(define-key evil-snipe-active-mode-map "s" 'evil-snipe-repeat)
(define-key evil-snipe-active-mode-map "S" 'evil-snipe-repeat-reverse)

It works well enough, but I feel like my approach is a little hacky (using transient maps). I'll see if I can figure out a better solution.

ReneFroger commented 9 years ago

Thanks for your reply. It's awesome, I will try it out soon after configuring Evil! (I was going to list the possible alternatives, which your plugin is one of them, when I make the switch from Vim to Emacs).

hlissner commented 9 years ago

In case you're still using this plugin: native Clever-F style repeating was implemented a while ago and evil-snipe-active-mode-map was removed.

You can either replace evil-mode's native f/F/t/T/;/, functionality with evil snipe (which also enables evil-snipe repeating with s/S/f/F/t/T/;/,) like so:

(evil-snipe-replace-evil)

Or just enable s/S repeating with:

(evil-snipe-enable-sS)