"vw" selecting the first char of following word

Vegard Øye vegard_oye at hotmail.com
Fri Jun 17 23:35:37 CEST 2011

On 2011-06-17 20:59 +0200, Frank Fischer wrote:

> Furthermore I can't find any hint in the documentation why 'w'
> should behave differently in visual mode than the usual cursor
> motion, which IS to place the cursor at the first character of the
> next word.

It depends on whether the selection is inclusive or exclusive. Vim
actually has an option for this, whose existence I only discovered
because the defaults are /sometimes/ different on Windows. To enable
an exclusive, Emacs-like selection in Vim:

    :set selection=exclusive

This will not include the character under the cursor in the selection.
Conversely, selection=inclusive will include it. I suspect that York's
setting is somehow the former.

In Vimpulse, the inclusiveness of the Visual selection is hard-coded,
so there is no way to change it. In Evil, it can be toggled with:

    (setq evil-visual-char 'exclusive)

Whatever the reasons for Vim's inconsistent behavior on Windows,
the default /is/ "inclusive", cf. :help selection.


More information about the implementations-list mailing list