I’m looking for a shortcut in Visual C# Studio 2012 ( if it exists ), that will insert a line of comment like so:
/******************************************************************************/
These make the code more readable for me. What I want to achieve is to separate blocks of code which are written to achieve different things. Let’s say:
/****************************************************************************/
{
// block that does something
}
/****************************************************************************/
{
// block that does something else
}
/****************************************************************************/
What I don’t want to do is press and hold “*” until it prints the right number of stars.
Don’t want to copy paste such comments.
Any hints?
————–EDIT————–
Solution found:
Steve Fenton – creating a snippet, tyvm 😉
You can create custom code snippets in Visual Studio that will speed this up, but please discuss this to ensure everyone working on the code is happy with the convention. In a modern IDE this kind of commenting is really noisy and many people don’t want the code littered with this kind of delimiter.
You import snippet files using
Tools > Code Snippet Managerand place them under the appropriate language.Once imported (you may need to restart Visual Studio) you type the shortcut and hit tab… i.e.
bigcthenTAB.File: bigc.snippet
There are instructions on creating custom snippets on Codeproject – written for 2010, but applicable to 2012.