DevOps – Accelerating Development with Code Snippets

I am so, so late to the code snippet party and I feel like I’ve wasted my youth @iwritecodesmtms

Apr-30-2018 16-37-43

I recently discovered the power of Code Snippets in Visual Studio. They’re super easy to make and can save you a ton of typing for repetitive tasks. This is a brief guide on making a new snippet in VS for Mac.

Simply click the Visual Studio menu and select preferences. Then, scroll down to snippets to view a list of pre-made and custom snippets, where you’ll get a preview of the snippet output and a short description.

Screen Shot 2018-04-30 at 4.33.45 PM

Add or Edit a snippet to get the detailed view, where you can tailor the snippet to your needs.

Screen Shot 2018-04-30 at 4.33.32 PM.png

Any variable defined by the $ can then be configured in the right hand menu to have defaults that you set.

To export or import gists, simply copy files to and from ~Library/VisualStudio/<version>/Snippets (at the time of writing, <version> was 7.0 – even though I am on a higher “minor” build of VS Mac)

You can find a few of the snippets I’ve created already over in my gist. Shout out to Hussain Abbasi of IntelliAbb who posted a few weeks back and opened my eyes to the wonderful world of snippets. His blog post has a huge swath of useful snippets for Xamarin.Forms and beyond!

2 thoughts on “DevOps – Accelerating Development with Code Snippets

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s