Visual Studio (Code)
Shortcuts and QoL features
ctrl + T
- search for a class. If you want to search forUserController.cs
you can typeUCont
and it will find itctrl + shift + P
- search inside Visual Studio optionsctrl + D
- duplicate actual linealt + ↑ / ↓
- move code lines
Auto-complete placeholders
prop
- creates a new property for a classctor
- creates a new constructorcw
- creates a newConsole.WriteLine()
statementtry
- creates atry-catch
statement
To create a new property, type prop
, hit twice tab and it creates a property template which you can navegate and override
Multi-caret and multi-cursor editing
For lines that are aligned
alt
+mouse click
- selects a block to editalt
+shift
+arrow
- same with keyboard
For multiple places that are not aligned
ctrl
+alt
+mouse click
- click where you want to add a caret- (select the word you want to match)
alt
+shift
+;
- vstudio selects all locations that match selected text in the current document and you may edit themDebug in VsCode
Watch a variable
En la pestaña watch se puede introducir el nombre de una variable y al hacer debug mostrará siempre el valor de esta variable.