Giter VIP home page Giter VIP logo

vsmac_code_snippets's Introduction

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

Demo

Alternatively you can copy all *.xml files from /snippets/$lang$ to ~/Library/VisualStudio⁩/{version}/Snippets.

How to use a code snippet?

Simply type the shortcut for example ctor and double press the Tab key.

The snippets

C#

Shortcut Description
dw Template for Debug.WriteLine($)
classnpc Template for a class implementing INotifyPropertyChanged.
measure Template for measuring execution time using Stopwatch
propb Template for a BindableProperty
propnpc Template for a Property with INotifyPropertyChanged

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 Mac or copy an existing one from ~/Library/VisualStudio⁩/{version}/Snippets to vsmac_code_snippets/snippets/$lang$ directory.
  • Update the README.md.
  • Create a Pull Request.

vsmac_code_snippets's People

Contributors

yuv4ik avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.