Visual Studio Macro to create a new snippet
Aymeric Gaurat-Apelli: Thanks to François Beaussier for hosting this blog post as my technical blog is no longer available.
Summary
I have written a Visual Studio macro that turns Visual Studio into a Snippet Editor. You simply select the piece of text you want to use in your snippet and the macro will create a snippet that will automatically be loaded by Visual Studio.
Download the latest macro here.
How to use it?
Write the snippet code from within Visual Studio as if you were writing code. Use the syntax $Anything$ to declare Intellisense literals. ($end$ and $selected$ are already used by Visual Studio)
Run the macro from the Macro Explorer:
I suggest you to associate it to a keyboard shortcut, like Alt+S:
The macro will prompt you for the name of the new snippet:
That's it! You can now use your new snippet in Visual Studio.
How to install it?
Open the Macro Explorer by pressing Alt+F8 or through the Tools menu:
In the Macro Explorer, right-click on the Macros node, select "Load Macro Project..." and choose the vsmacros file you downloaded (here)
You should be able to see the "CreateSnippet" macro in the Macro Explorer:
Finally, you will need to edit the macro to fit your environment settings:
Change the author and snippetsPath variables. snippetPaths should be a path that has been added to the Macros Manager (the My Code Snippets folder exists by default)
Save the macro and you are good to go!
Thanks
Big thanks to Patrick Galluci who wrote this article about snippets. My macro is a simple improvement of his great macro.
9 Comments:
hello... hapi blogging... have a nice day! just visiting here....
By Anonymous, at 3:00 pm
Thank you for the article, really useful data.
By www.albacete-3d.com, at 8:25 pm
The Basics Of Mulch Gardening And Topsoil
Here is my site ... landscaping milwaukee wi
By Anonymous, at 4:45 pm
The other day, while I was at work, my cousin stole my iPad and tested to see if it can survive a twenty
five foot drop, just so she can be a youtube sensation.
My iPad is now broken and she has 83 views. I know this
is totally off topic but I had to share it with someone!
Feel free to visit my page :: affordable-dental-plan.org
By Anonymous, at 11:47 am
You have made some good points there. I checked on the net
for additional information about the issue
and found most individuals will go along with your views on this site.
My blog post - paydayloansdirectlenders4u.co.uk
By Anonymous, at 12:14 am
Awesome issues here. I am very happy to peer your article.
Thanks so much and I am having a look forward to contact you.
Will you kindly drop me a e-mail?
Also visit my web-site :: compendium.itcilo.org
By Anonymous, at 12:16 am
Write more, thats all I have to say. Literally, it
seems as though you relied on the video to make your point.
You clearly know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be
giving us something informative to read?
Have a look at my webpage :: kredytopedia.pl
By Anonymous, at 4:57 am
I tend not to leave many remarks, however I looked at a few of the remarks
on "Visual Studio Macro to create a new snippet".
I actually do have 2 questions for you if you tend not to mind.
Could it be simply me or do some of these comments look
like they are left by brain dead folks? :-P And,
if you are posting on additional online social sites, I'd like to follow everything new you have to post. Would you make a list of the complete urls of your shared pages like your Facebook page, twitter feed, or linkedin profile?
my webpage ... marcusdruen.blogspot.com
By Anonymous, at 6:40 pm
Tulisan yang bermanfaat :)
Salam kata bijak
Jangan lupa kunjungi.
kata mutiara bijak
kata cinta romantis
kata persahabatan
kata mutiara bersyukur
kata bijak motivasi
kata bijak lucu
kata gombal
kata putus cinta
kata galau
ucapan pernikahan
kata bijak facebook
kata bijak pernikahan
kata bijak kehidupan
ucapan putus cinta
kata cinta motivasi 2015
By Kata Bijak, at 3:29 pm
Post a Comment
<< Home