Thomas wrote:

> > ":behave mswin" only sets a few options, but it is often used in 
> > conjunction with ":source $VIMRUNTIME/mswin.vim", which sets a lot of 
> > potentially dangerous mappings.
> I only have behave mswin in my vimrc.
> 
> This happens with gvim -u NONE --noplugin.
> 
> > When you do ":behave mswin" the shifted cursor keys start Select mode.
> > What you type then replaces the selected text.
> >   
> 
> The autocommand is
> 
> au CursorMoved * norm! zz
> 
> which holds the cursor in the middle of the screen.
> 
> As soon as I switch to selection mode (no matter how) and then move the 
> cursor (trigger the autocommand), the zz is not issued as normal command 
> but inserted in the buffer. IMHO this is wrong.
> 
> IMHO the zz should still be a normal mode command and norm! should be 
> aware of selection-mode and issue the autocommand as if <c-o> were typed 
> beforehand.

Vim can't know what the CursorMoved autocommand is used for.  You could
also use it for updating the status line or something else where you
don't want to stop Select mode.  And that could involve a ":normal"
command where you want to keep Select mode.  This is also a valid
command:  :exe "normal <S-Right>"

When in Select mode you are still in sort-of Normal mode.  Your
autocommand will have to take care of mode stuff by itself.  You can use
CTRL-\ CTRN-N to make sure you are in Normal mode.

-- 
It is illegal for a driver to be blindfolded while operating a vehicle.
                [real standing law in Alabama, United States of America]

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to