Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010: How to use the prop snippet?

Excuse my ignorance. I just saw Scott Hanselman's video on MVC 3 where he typed prop, which I had not seen before. I tried it but I am doing something wrong. LOL

I type prop which expands to

public TYPE Type1 { get; set; }

and highlights TYPE. I type the data type which replaces the word TYPE, hit tab to move to the Type1 placeholder and start typing, but it doesn't replace Type1, just types in front of it.

What's the correct way to move between TYPE and Type1 so that it highlights and replaces these placeholders as you type, and to move to the next line?

All the stuff I found on the Internet just said it creates this for you, but didn't say how to use it.

like image 674
Zachary Scott Avatar asked Dec 22 '22 21:12

Zachary Scott


2 Answers

Press Tab twice after replacing TYPE, thats will be delete word Type1.

like image 105
AlexandrYZ Avatar answered Dec 28 '22 11:12

AlexandrYZ


Press TAB to expand the snippet, TAB to loop through all the placeholders, and ENTER to commit the snippet once finished.

Note: C# and HTML/ASP.NET/JScript snippets all behave approximately the same. VB snippets behave slightly different in that pressing ENTER does not commit the snippet (which is very annoying IMHO).

like image 41
Jimmy Avatar answered Dec 28 '22 11:12

Jimmy