[implementations-list] Dear readers: We need ten minutes of your time to test Vegard's vimpulse-modal so we can decide if to include it in Vimpulse or not

Jason Spiro jasonspiro3 at gmail.com
Mon Jan 18 02:13:04 CET 2010


Dear implementations-list readers,

We need a volunteer to test vimpulse-modal.el, a file which Vegard
wants included in Vimpulse.  Vegard can't volunteer, since he himself
wrote vimpulse-modal.  But anyone else who uses Vimpulse can
volunteer, even if they don't know how to code in elisp, and even if
they're not an expert at using Vimpulse.  Just tell us:

*  if vimpulse-modal worked for you,
*  whether you think that it makes Vimpulse better or not,
*  and any comments, if you have any.

Alessandro is too busy to volunteer, and I'm not really interested.  I
haven't been using Emacs much lately.

You can download vimpulse-modal from
http://my-trac.assembla.com/vimpulse/ticket/14 -- look in the
"Attachments" section.

Once you test it, just reply to this email to send your test results
to the mailing list.  One person's opinion is enough for us to decide
if vimpulse-modal merits being included in Vimpulse or not.  But even
if someone else has posted their opinion, you can post your opinion
too if you want.

The rest of this email is Vegard's description of vimpulse-modal,
copied from the Trac ticket for it.

Thanks in advance,
-Jason



The `:map`, `:imap` and `:vmap` commands of Vim let one make two key
mappings starting with the same sequence of characters without one
overwriting the other. For example:

:imap aa foo
:imap aaa bar

When Vim has read "`aa`" in Insert mode, it will wait for another
character to decide whether to insert "`foo`" or "`bar`". If the user
types "`a`", "`bar`" is inserted; if another letter, "`foo`" plus that
letter.

Compare with the analogous use of Emacs' `global-set-key` function:

(global-set-key "aa" 'foo)
(global-set-key "aaa" 'bar)

Here, the first binding is simply overwritten by the more specific
second. The end result is that "`aaa`" is bound to `bar`, while any
other sequence starting with "`aa`" is not bound to anything.

`vimpulse-modal.el`, attached, provides a set of Vim-like or "modal"
functions for making new keybindings "on top of" previous bindings.
They are `vimpulse-map`, `vimpulse-imap` and `vimpulse-vmap`, which
mimic Vim's commands, and `vimpulse-define-key`, a generic function
for specifying the keymap. To load it, issue

(require 'vimpulse-modal)

Then, for example, the key sequences "`cae`" and "`dae`" may be bound
in vi (command) mode using `vimpulse-map`:

(vimpulse-map "cae" 'vimpulse-change-a-sexp)
(vimpulse-map "dae" 'vimpulse-delete-a-sexp)

This will execute `vimpulse-change-a-sexp` when typing "`cae`" in vi
mode, while retaining keys like "`cw`" for "change word" or "`cas`"
for "change a sentence".

Just for demonstration purposes, `vimpulse-change-a-sexp` and
`vimpulse-delete-a-sexp` are indeed real text object commands, defined
and bound at the end of the file as shown. They act on Lisp
S-expressions. I am not suggesting they be made part of Vimpulse, just
making a point about extensibility.



More information about the implementations-list mailing list