I know there’s a shortcut to duplicate a selected text:
To Copy Up – shift
+alt
+up
To Copy Down – shift
+alt
+down
But how can I do if I need to duplicate it, say, 33 times? Is there a faster way to do that?
I know there’s a shortcut to duplicate a selected text:
To Copy Up – shift
+alt
+up
To Copy Down – shift
+alt
+down
But how can I do if I need to duplicate it, say, 33 times? Is there a faster way to do that?
3
Answers
Unfortunately, as far as I know, Visual Studio Code does not provide built-in functionality to automatically duplicate code a certain number of times.
If you know you might have to do this often, you could make a code-snippet for this. Maybe one that copies 10 rows at a time.
A fairly fast way to achieve this is to create your 33 (or however many) lines in your editor, then use the multi-line cursor (hold Alt + Shift then use your mouse to select the lines you want the cursor to include), and then paste your text, like so: