Edit multiple lines in Visual Studio Code

You have a file with multiple lines and you want to edit the same character place in every line simultaneously.

Imagine your file has file names as rows and you want to edit their extensions from dat to json:

file1.dat
file2.dat
file3.dat
file4.dat

In Visual Studio Code go to the first line, place the cursor between the dot and ‘d’, then hit CTRL+SHIFT+ALT all together and keep them down. Using the downward arrow move the cursor down on all the lines. When all lines are having the same cursor, edit the rows as you wish:

Note: some other editors need only SHIFT+ALT (without CTRL) to edit multiple lines

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.