Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select words from inside current word and backwards in vim

Tags:

vim

I've had some fun learning vim, but have encountered a problem. While it's fairly straightforward to select from inside the current word and forward (v + iw + w +w + ...), and backwards (v + b + b + ... or v + ge + ge + ...). (This question describes that process quite well: In Vim/Vi, how do you move the cursor to the end of the previous word? ). I know one solution is to move the marker to the end of the word before beginning the selection, but it seems less elegant than just including the entire word the cursor is in in the selection (like you can with iw when going forward (I think what I'm asking for is a sort of ib or modifier key to make w cycle backwards without making custom aliases)).

Is it possible or am I just being unreasonable? Sorry for the messy formatting.

like image 317
simonra Avatar asked Mar 21 '23 05:03

simonra


1 Answers

You are looking for viwo + b + b + b

like image 68
Boris Brodski Avatar answered Apr 05 '23 23:04

Boris Brodski