Learn how to insert a cursor at the end or beginning of every selected line in VSCode to enable mass-edit mode and save a lot of time!
Insert cursor at the end of every selected line in VSCode:
- Mac: Cmd + A to select all lines
- Windows: Ctrl + A to select all lines
- Alt/Option + Shift + I to insert cursor
Now you can add whatever you need to at the end of your lines.
You can also use your mouse to manually select the lines you want to edit instead of selecting them all with Cmd/Ctrl + A.
When you’re done you can disable mass-edit mode by clicking anywhere with your mouse.
Do the same as before. As soon as you have inserted your cursor at the end of each line do the following:
- Mac: Hold down the Fn button and tab your keyboard’s left arrow key
- Windows: tab twice on your keyboard’s Home button.
This will move your cursor to the beginning of every selected line.
Tip: if you have a customized your shortcut settings, you can find the function by searching for: "Add Cursors to Line Ends