Wednesday, February 11, 2009

Another handy vim shortcut

I learned this one just now...

Say you have the following text:

users:
name1, name2, name3, name4, name5, name6, name7, name8, name9, name10.

admins:
name11

And you want to move 'name5,' under admin.

Put your cursor on the n of 'name5', and use the following key sequence:


df,


That will delete forward everything up to the first comma it encounters.

Then, put your cursor under 'admins:' and hit:


p


For pasting.

0 comments: