On Thu, May 25, 2006 at 03:17:54PM +0200, Luc Hermitte wrote:
> * On Thu, May 25, 2006 at 08:30:52AM -0400, Benji Fisher <[EMAIL PROTECTED]> 
> wrote:
> 
> >      I see the following note in doc/version7.txt :
> > 
> > --- fixes and changes since Vim 7.0f ---
> > [...]
> > Prevent that using CTRL-R = in Insert mode can start Visual mode.
> 
> Must I understand that the workaround I've found won't work in the
> future ?  (the workaround consists in returning
> <c-\><c-n><c-\><c-n>gv<c-g> to i_CTRL-R=)

     AFAIK this will continue to work.  The change is what you already
noticed (I think):  if <C-R>= calls a function, and that function
changes the mode, that will not be respected.  It is OK if the function
returns characters that change the mode.

     You might also have a look at

:help :map-expression

I have not played with it yet, but I think the idea is to give a simpler
alternative to certain <C-R>= constructions.

> What about @= ? Can I use it to execute a sequence that will change the
> mode to insert- or select-mode, according to the result of my function ?
> Or is it also an undocumented feature that may not be supported in the
> future ?

     I am not sure what you have in mind.

     Changes like this are not at all common.  In this case, vim was put
in an undocumented mode, and Bram was afraid that its behavior would be
unpredictable in that case.  (It could be considered a bug, since all of
vim's modes are supposed to be listed under :help vim-modes .)

HTH                                     --Benji Fisher

Reply via email to