To add cursors at arbitrary positions, select a position with your mouse and use Alt+Click (Option+Click on macOS). You can add additional cursors to all occurrences of the current selection with Ctrl+Shift+L. Note: You can also change the modifier to Ctrl/Cmd for applying multiple cursors with the editor.
What are the keyboard shortcuts for creating multiple cursors in VS Code? Just hold down the Alt button and start clicking in different places. That's it. CMD+Alt+Down arrow is what you want.
Multi cursor edit is natively supported in Visual Studio starting from version 2017 Update 8. The following is an extract of the documentation:
Some of those commands are also available in the Edit
menu:
There is a new extension for Visual Studio 2017 called SelectNextOccurrence which is free and open-source.
This extension makes it possible to select next occurrences of a selected text for editing.
Aims to replicate the Ctrl+D command of Sublime Text for faster coding.
Features:
Visual Studio commands:
SelectNextOccurrence.SelectNextOccurrence
is bound to Ctrl+D by default.SelectNextOccurrence.SkipOccurrence
is not bound by default. (Recommended Ctrl+K, Ctrl+D)SelectNextOccurrence.UndoOccurrence
is not bound by default. (Recommended Ctrl+U)SelectNextOccurrence.AddCaretAbove
is not bound by default. (Recommended Ctrl+Alt+Up)SelectNextOccurrence.AddCaretBelow
is not bound by default. (Recommended Ctrl+Alt+Down)https://marketplace.visualstudio.com/items?itemName=thomaswelen.SelectNextOccurrence
https://github.com/2mas/SelectNextOccurrence
In the Visual Studio Shift+Alt+. / Shift+Alt+,
Shift+Alt+.
- match caret;Shift+Alt+,
- remove previous caret; Same function as on VSCode Ctrl+D
.
Much more setting Tool - Options - Environment - keyboard
. Next in the Show commands containing
enter Edit.
.
Also, can use keyboard schema Visual Studio Code
. Available for Visual Studio 2017
For conclusion, nice link Visual Studio All keyboard shortcuts
In Visual Studio 2019, you can put your caret on the right place and then press SHIFT ALT and . (dot). This will select the next occurrence.
MixEdit extension for Visual Studio allows you to do multiediting in the way you are describing. It supports multiple carets and multiple selections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With