Select multiple lines in VS Code
How to select multiple lines to edit at once within VS Code
If you want to make edits to multiple places in a file and Find and Replace isn’t an option, you might want to make use of VS Code’s ability to select multiple locations at once.
By holding down the Option
/ Alt
key you can use the mouse cursor to select different places you want to set a cursor to. You will notice that multiple cursors appear on screen at once and will respond to keyboard commands, so using the arrow keys will move all cursors in the same direction etc.
If all your edits are happening in the same column of text, but across multiple lines, you can also hold Command
+ Option
/ Alt
and use the Up
or Down
keys to add a new text cursor above or below where you are.