VS for Mac Code Snippets
Is a collection of useful code snippets (shortcuts) to reduce the amount of boilerplate code typing.
What is a code snippet?
Code snippets are ready-made snippets of code you can quickly insert into your code.
There are a couple of code snippets that are shipped with Visual Studio:
ctor - Creates a constructor for the containing class. prop - Creates an auto-implemented property declaration. forr - Creates a for loop that decrements the loop variable after each iteration.
More information and the full list of built-in code snippets can be found in the official docs.
How to add a code snippet
Visual Studio > Preferences > Text Editor > Code Snippets
Alternatively you can copy all
*.xml files from
How to use a code snippet?
Simply type the
shortcut for example
ctor and double press the
|classnpc||Template for a class implementing
|measure||Template for measuring execution time using Stopwatch|
|propb||Template for a
|propnpc||Template for a Property with
Please note that you can set your own shortcut and customize the snippet according to your needs.
How to contribute
If your favorite code snippet is not in the list you are more than welcome to contribute!
Please follow the next simple steps:
- Create a snippet using
VS for Macor copy an existing one from
- Update the
- Create a Pull Request.