Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to yank the entire element without moving to the beginning?

When my cursor in middle of a word, and I want to yank the whole word, I must press b first, and press yw to yank it.

I want to know can I yank the word without hitting b first?

like image 250
Rocky Avatar asked Dec 28 '11 06:12

Rocky


1 Answers

yaw is yank around word, meaning if there is a space after the word, it will grab it too (but not a space before).

yiw is yank inside word, which yanks just the word characters.

You can see what will be yanked by vaw or viw to select the same characters. You could then also hit y to perform the yank.

i and a of course apply to all the other VIM groups, like W, which is any non whitespace.

like image 73
Andy Ray Avatar answered Nov 15 '22 08:11

Andy Ray