"vw" selecting the first char of following word
Hi Vegard, Just wanted to make sure you didn't miss this message. I noticed a new bug, probably introduced recently. "vw" is not working properly, it selects not only the current word, but the first character of the following word as well. York
Am Fri, 17 Jun 2011 10:51:29 -0400 schrieb York Zhao <[email protected]>:
Hi Vegard,
Just wanted to make sure you didn't miss this message. I noticed a new bug, probably introduced recently.
"vw" is not working properly, it selects not only the current word, but the first character of the following word as well.
This is not a bug but intended. 'v' enables visual mode, 'w' moves the cursor to the beginning of the next word. If you want to select the current word only, use 'viw' or 've'. Btw, this is the same behavior as vim's. Frank
Hi, If you try it in Vim you will notice that the first char of the next word is never being included in the selection when you press "vw". Unless this is impossible to implement, I don't think it is a desired operation, and there is no point to use "viw" when "vw" can do the same thing (why type one more character?). Thanks, York On Fri, Jun 17, 2011 at 12:43 PM, Frank Fischer < [email protected]> wrote: Am Fri, 17 Jun 2011 10:51:29 -0400 schrieb York Zhao <[email protected]>:
Hi Vegard,
Just wanted to make sure you didn't miss this message. I noticed a new bug, probably introduced recently.
"vw" is not working properly, it selects not only the current word, but the first character of the following word as well.
This is not a bug but intended. 'v' enables visual mode, 'w' moves the cursor to the beginning of the next word. If you want to select the current word only, use 'viw' or 've'. Btw, this is the same behavior as vim's. Frank _______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Am Fri, 17 Jun 2011 13:27:46 -0400 schrieb York Zhao <[email protected]>:
Hi,
If you try it in Vim you will notice that the first char of the next word is never being included in the selection when you press "vw". Unless this is impossible to implement, I don't think it is a desired operation, and there is no point to use "viw" when "vw" can do the same thing (why type one more character?).
Well, I'm sorry, but at least in my Vim 7.2.445, standard installation on debian squeeze, without any customizations, the first character of the next word is ALWAYS included in the visual selection after typing 'vw'. So I can't reproduce the behavior you described. 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. Frank
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. -- Vegard
participants (3)
-
Frank Fischer -
Vegard Øye -
York Zhao