bind <tab> to vimpulse-abbrev-expand-before in insert mode

Štěpán Němec stepnem at gmail.com
Fri Dec 17 20:04:32 CET 2010


Titus von der Malsburg <malsburg at gmail.com> writes:

> I can say
>   (global-set-key (kbd "TAB") 'vimpulse-abbrev-expand-before)
> and that works.  But
>   (vimpulse-imap (kbd "TAB") 'vimpulse-abbrev-expand-before)
> throws an error:
>
> Debugger entered--Lisp error: (args-out-of-range [] -1)

[...]

Hm. Looks like `vimpulse-imap' is doing something strange. I've been
(almost) living in blissful ignorance of all things Vimpulse/Viper for
some time, so instead of trying to figure out what it might be, here's
another suggestion:

I never use the `vimpulse-FOO' binding commands. What I would do to get
what you want[1] is this:

(define-key viper-insert-global-user-map "\C-i" 'vimpulse-abbrev-expand-before)

> C-h c C-v says "C-v runs the command cua-paste" although vimpulse.el
> (which executed without errors) contains:
>
>   (define-key viper-vi-basic-map "\C-v" 'vimpulse-visual-toggle-block)
>
> Executing this line doesn't throw an error but also doesn't fix the problem.

I see. So you're using CUA mode, right? I have no experience with it,
but surely enough when I enable it, C-v breaks. Looks like the CUA mode
bindings get even higher priority than the Viper ones. I have no idea
why anybody would want to use the CUA bindings and Vim emulation at the
same time. Are you sure you really want that? Some key map surgery would
be necessary in that case, or perhaps CUA mode provides some way of
customizing the binding setup?

[1] Let me just note that I would never want anything like that myself
;-) -- Tab is too precious to hardcode it to something like
`vimpulse-abbrev-expand-before'.

  Štěpán



More information about the implementations-list mailing list