[implementations-list] Vimpulse update

Marius Andersen rezonatix3 at yahoo.no
Wed Jun 24 18:00:47 CEST 2009

> Fra: Alessandro Piras <laynor at gmail.com>
> Emne: Re: [implementations-list] Vimpulse update
> Til: "Vi/Vim implementations list" <implementations-list at lists.ourproject.org>
> Dato: Mandag 22. juni 2009 13.34
> it's easy stuff actually :) It works like this:
> I modified the viper-prefix-arg-com function to introduce 4
> new commands: da di ca ci. These commands will read-char to get motion
> command.

Yes, this is a very good way to do it. It means more objects can be easily added without any more mucking around in `viper-prefix-arg-com'.

Anyway, I mailed Michael Kifer and asked if there was a way to avoid redefining `viper-prefix-arg-com', and he replied he couldn't think of one. So until the original function is redesigned, which will probably not happen any soon, I think we can hold on to the present approach. :)

What now remains is copying commands, `yiw', `yas', etc., and visual commands like `viw' and `vas'. The former requires updating `viper-prefix-arg-com' with entries for `vimpulse-yi' and `vimpulse-ya', while the latter is just a matter of writing commands for moving the cursor. For example, `vas' moves the cursor one sentence forward if it's at the end of the selection, and one sentence backward if it's at the beginning.

I think this illustrates another point, incidentally: the power of vi comes from the multitude of ways of combining very basic commands, but implementing those combinations requires lots and lots of code. Therefore I think building vimpulse.el on top on Viper, rather than implementing Vim emulation from scratch, is the better approach.

Marius Andersen

Alt i ett. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com

More information about the implementations-list mailing list