[Question] Why is the behaviour for `aw` different when Visual Mode is already active?

I am quite new to Neovim (and rusty with Vim) so I’m working through Practical Vim. I’m now familiarizing with gn and found out some odd behaviour (this happens both in nvim v0.8.0 and in vim 9.0 even when started without plugins, and using different terminals).

With an existing text [ this is somelongword test ]

  • Enter character visual mode and select long
  • Press aw to try and expand the visual selection to the complete word somelongword
  • But instead only the right half will be selected longword
  • Go back to normal mode Esc
  • Obviously, vaw from any cursor position within somelongword will highlight the entire word

Now this might be an expected behaviour, if there wasn’t a[. Using the same text as above

  • Enter character visual mode and select long
  • Press a[ and it will expand to both sides, selecting the entire text [ this is somelongword test ]

Is this intentional? My usecase is the following: I’m searching for /long and use gn and end up in the middle of a word, I now want to expand the selection to replace the entire word. Right now I’d have to do awob which kind of feels wrong.

I’ve attached a screen recording within vscode (sorry, easier to record there, but sadly only uppercase letters, please ignore them) with a similar sentence.

Thank you!
vaw

That’s just how (Neo)Vim works in Visual mode.
You can either press <Esc> and then do vaw, or you can press * which should select the whole word. Only downside is that * will also jump to the next match, but you can avoid that from happening by using vim-asterisk plugin.

Thanks for the reply! Yeah I guess I just still find it weird since then there is no difference between aw and w.