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 wordsomelongword
- But instead only the right half will be selected
longword
- Go back to normal mode
Esc
- Obviously,
vaw
from any cursor position withinsomelongword
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!