Which map is active when I overwrite text with R
frank.fischer at mathematik.tu-chemnitz.de
Mon Mar 12 15:33:49 CET 2012
On Fri, Mar 09, 2012 at 04:11:29PM +0100, Titus von der Malsburg wrote:
> On Fri, Mar 9, 2012 at 9:14 AM, Frank Fischer
> <frank.fischer at mathematik.tu-chemnitz.de> wrote:
> > On Wed, Mar 07, 2012 at 03:45:41PM +0100, Titus von der Malsburg wrote:
> >> In insert mode, I bind TAB to a custom expand function that is based
> >> on hippie-expand.
> The thing is now that when I bind TAB to my expand function and hit
> TAB in replace state it doesn't overwrite the existing text with the
> expansion but inserts the expansion. I think I would fix that by
> binding TAB in replace state to a wrapper of my expand-function that
> first determines the expansion, inserts it, and then deletes a string
> that is as long as the expansion following the expansion. While this
> should work, I'm wondering: is there a better way to do this?
> Specifically, I'm wondering if evil has a way to make the overwriting
> transparent for the expansion function.
Currently not. The problem is that the expansion function probably
calls something like (insert ...) which does not obey whether
overwrite-mode is enabled or not. The problem is that it's hard to
judge whether command does real overwriting or plain insertion, so
it's not clear what to do in all situations. Some commands like
`dabbrev-expand' may only insert text (the first expansion) or remove
and replace with other text (on successive invokations). This gets
more interesting if the second candidate is shorter than the first
one. Evil has already some magic to restore overwritten text when
removing the newly inserted text with [backspace], so this problem may
be solvable. Nevertheless I think there is at least no trivial
solution for this problem that works in general.
More information about the implementations-list