A multi-cursors editing is a technique that allows a user to select multiple lines and make multiple simultaneous edits at once.
The multiple cursors feature is available in a Visual Studio Code (VSCode) out of the box.
This short note shows how to select and edit multiple lines simultaneous using the VSCode’s multiple cursors feature.
Cool Tip: How to reset a Visual Studio Code! Read more →
Multiple Cursors in VSCode
Use the following keyboard shortcuts to enable multi-line editing in the Visual Studio Code:
|Ctrl + Alt and then ↑ or ↓||Windows|
|Shift + Alt and then ↑ or ↓||Linux|
|⌥ Opt + ⌘ Cmd and then ↑ or ↓||MacOS|
Here is how the multi-line editing in the Visual Studio Code looks like:
You can also place the cursors arbitrarily by holding the Alt key and left-clicking:
To switch back from the multi-cursors editing to a single cursor, press the Esc key.
Cool Tip: How to clone a Git repository in a Visual Studio Code! Read more →
To view or edit shortcuts, go to the “File” → “Preferences” → “Keyboard Shortcuts”.