quick vim question: how to duplicate column and paste next to it?

endervalentine

Senior member
Jan 30, 2009
700
0
0
Sorry, my google skills are failing me this monday ...

I have this column
aaa
bbb
ccc
ddd
eee


I want this:
aaa aaa
bbb bbb
ccc ccc
ddd ddd
eee eee

Any suggestions?
 

endervalentine

Senior member
Jan 30, 2009
700
0
0
nvm, got it ... ctrl-v works+ yank and paste works, just need to get add spaces to my selection to capture everythign since the elements were different widths.
 

AtlantaBob

Golden Member
Jun 16, 2004
1,034
0
0
nvm, got it ... ctrl-v works+ yank and paste works, just need to get add spaces to my selection to capture everythign since the elements were different widths.

For what it's worth, seems like it might be easiest to do this (at least with large amount of data) with awk.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,566
4,483
75
.* means everything, starting from the first match, which is any character; so that gets the whole line.
& copies everything that was matched, so here that's the whole line. Twice. :)

If you don't know what :%s does, look it up!