Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
512 views
in Technique[技术] by (71.8m points)

Paste multiple times in Vim

This maybe really simple, But I tried searching and I ended up with stuff like copying multiple lines, cut and paste multiple lines etc. What am looking for is pasting a single line multiple times in Vim.

For eg. A line 'X' is copied and I want to paste this line alone for say 30 times, thus I will have 30 'X' lines. Is it possible with a single command in Vim? Please help me.

Note: A single command for paste. Copy of the line can be done by 'y'. for pasting 30 times or so, I need a single command. Please help me here.

question from:https://stackoverflow.com/questions/16700989/paste-multiple-times-in-vim

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes. Put before the command the number of times you want to repeat the action. And this works with many of vim commands. It would be:

30p

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...