I am looking for a keyboard short-cut to complete creating the default accessors for a property in a C# class.
Something like...
I start typing:
public int Id
Then I press one or more keys, and I endup with:
public int Id { get; set; }
All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.
Edit.SelectionCancel. Surround with. Ctrl+K, Ctrl+S. (available only in Visual Studio 2019 and earlier)
Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.
The shortcut is the trigger "prop":
prop
tabtabint
tabId
tab
and you end up with:
public int Id { get; set; }
Try with propfull
, then TAB Twice and you'll get:
private int myVar; public int MyProperty { get { return myVar;} set { myVar = value;} }
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