Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: How to shrink the visual area

Tags:

vim

Let's say that I've got the following text:

This allows you to select some text using Vim's visual mode

With the cursor on the 'a' in 'allows'. If I type vaw I switch to visual mode and then select "a word" ("allows "). If I repeat the aw then Vim also selects the "you ". Let's say I do this once more (highlighting "to ") and then realize that I've gone too far.

Is there a way to shrink/reduce the size of the visual area (other than using the h,j,k,l keys)?

I'd love to be able to either 'undo' my last command (i.e., have Vim move the selection back to before I typed that last 'aw') or else use the motion/text object commands to reduce the size of the visual area.

like image 769
MikeTheTall Avatar asked Sep 05 '25 03:09

MikeTheTall


1 Answers

yes, you can keep pressing ge till it selecting allows again.

like image 99
Kent Avatar answered Sep 08 '25 06:09

Kent