Is there a way to select multiple non-adjoining (totally separate) texts in VS? I can do it in MS Word by selecting the texts separately by holding the Ctrl button, like this:
My version is 11.
Edit: I'm not talking about Alt+Select
block selection. Also I would love to see if there exist a technique in Notepad++.
Multi cursor edit is natively supported in Visual Studio starting from version 2017 Update 8. Here is the documentation:
Multi-caret selection
and here is a screenshot of available command:
Now the plugin is Multi Line tricks. The end and start buttons broke the selection.
There is a new extension for Visual Studio 2017 called SelectNextOccurrence which is free and open-source.
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
I couldn't find anything built in, which is sad. There is this functionality in CodeRush though.
With Notepad++, this feature comes in built in. Just turn on multi-editing from
But its not as intuitive as MS Word which lets you select two words by double clicking on them (after Ctrl of course).
From Visual Studio 2017 Version 15.8, Ctrl + Alt + Click is now supposed to be a built-in way to manage multiple carets.
https://blogs.msdn.microsoft.com/visualstudio/2018/08/30/improving-your-productivity-in-the-visual-studio-editor/
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 theShow commands containing
enterEdit.
.Also, can use keyboard schema
Visual Studio Code
. Available for Visual Studio 2017For conclusion, nice link Visual Studio All keyboard shortcuts