magnars / annoying-arrows-mode.el

Emacs gets annoyed when you navigate around your document one char at a time.
10 stars 4 forks source link

Evil support? #5

Closed ghost closed 9 years ago

ghost commented 9 years ago

Would it be possible to add evil-support?

I am a total elisp newb, so uncertain about the best way to do it, but just using an (if (bound-and-true-p evil-mode)) should allow you to change what arrow-advice is given depending on whether evil-mode is used.

(if (not (bound-and-true-p evil-mode)))
  (progn
    old advice...)
  (progn
    (add-annoying-arrows-advice evil-forward-char '(evil-find-char smart-forward evil-set-marker))
    (add-annoying-arrows-advice evil-backward-char '(evil-find-char-backward smart-backward evil-set-marker))
    (add-annoying-arrows-advice evil-next-line '(smart-forward ace-jump-mode evil-set-marker))
    (add-annoying-arrows-advice evil-previous-line '(smart-forward ace-jump-mode evil-set-marker))
    (add-annoying-arrows-advice evil-delete-backward-char '(evil-delete-backward-word evil-delete))))

Another problem is that many of the functions I want to suggest for annoying arrows advice take numerical arguments so your macro does not read them properly. Don't know if this is easy to work around or not.

I understand if this is too much work to fix and that you might not be interested. If so, is it okay if I make an evil-annoying-arrows and add it to elpa? Will change the macro to a function that has hardcoded text strings suggesting alternative motions and hope for some pull-requests.

magnars commented 9 years ago

I'm perfectly fine with a separate evil-annoying-arrows package, or if you want to add a pull request that's good too. :)