Visual Studio lets you edit multiple lines at the same time. This is very useful when you need to apply the same change to several lines at once, for example when adding a modifier to multiple properties.
#Multi-line editing using the mouse
Press Alt while selecting the block with the mouse:
#Multi-line editing using the keyboard
Press Alt+Shift+Arrow to select the block to edit:
#Multi-carets editing
If you want to edit multiple non-contiguous locations, you can use multi-cursor editing. Press Ctrl+Alt and click each location where you want to place a caret.
#Insert carets at all matching locations
You can insert a caret at all places where the current word exists. Select the word you want to match and press Alt+Shift+;. Visual Studio will select all the locations that match the selected text in the current document.
You can select just the next matching location by using Alt+Shift+.
This post is part of the series 'Visual Studio Tips and Tricks'. Be sure to check out the rest of the blog posts of the series!
Do you have a question or a suggestion about this post? Contact me!