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.
Ocurre lo mismo al hacer click derecho sobre una variable en modo debug. Hay una opción Quickwatch para añadir esa variable.
Go back when debugging
Si te has pasado un breakpoint puedes volver a ejecutarlo arrastrando el punto de ejecucion actual (la linea donde estas actualmente) hasta donde la quieres
Conditional breakpoints
You may also set conditional breakpoints with right click when setting a breakpoint.