vim mode: Fix off-by-one errors in word selection.

The below conforms to Vim's behavior regarding whitespace trimming.