evil inside

Timothy Harper timcharper at gmail.com
Fri Aug 12 19:50:19 CEST 2011


Just wanted to post that I switched out vimpulse for evil, and I am digging it! Great work guys!  It feels more responsive, and less buggy.

I've started to extend evil to implement surround. So far I have surround region implemented, that was easy. evil-define-key works brilliantly.  Change surround / delete surround is going to be a little more tricky though.

Previously, my approach was to implement custom text objects that were flagged as surrounding text objects. Then I implemented vimpulse-delete-surround-or-delete, vimpulse-change-surround-or-change, bound then to 'd' and 'c' respectively, and prompted for a text object. If the returned text object was flagged as a surround text object, I acted accordingly, otherwise forwarded on to vimpulse-delete / vimpulse-change.

I think a better approach, this time, would be to implement evil-change-maybe-surround. It would prompt for the next keystroke.  If 's', then prompt for a text object and perform the operation. Otherwise, stick the key back into unread-command-events and forward to evil-change.

Does a better extension mechanism exist, or is that approach a good one in your eyes (Vegard?)

Thanks so much for bringing evil to my emacs! :)

Tim


More information about the implementations-list mailing list