Subscribe to Sergio Tapia - Lost in the GC.        RSS Feed
***** 2 Votes

A little Visual Studio 2010 tip that will probably save you some time.

Icon 9 Comments
This is just too cool, I just found out about it and had to post it here.

If you type in prop and press TAB TAB, you'll get this:

Posted Image

Posted Image

Now is that something or what? Talk about a time saver! Especially when you're working with MVC3 and you're constantly changing properties.

What do you think? Any other cool templates out there I should know about? :)

9 Comments On This Entry

Page 1 of 1

[email protected] 

11 August 2011 - 07:25 AM
there is ctor for constructors, that helps a lot for me at least

Sergio Tapia 

11 August 2011 - 07:26 AM
My mind is blown. I feel like a Vim user who just discovered Emacs.


11 August 2011 - 08:33 AM
Easy on the Vim users.

Great tip. Just started a new job that uses VS 2008 and 2010. Loving it so far, but it is little things like this that make me really happy.

(Recovering Vim-aholic (2 months without using Vim for Java, C#, PHP))


11 August 2011 - 10:38 AM
AFAIK you can use the double tab to use complete various snippets.

like class + TAB TAB creates the basic:

class MyClass


foreach + TAB TAB results in:

foreach (var item in collection)

...and so on, basically if you know a snippet by name press TAB + TAB to autocomplete the outlay.
Now you're able to change variables/variable names,pressing ENTER will move to the next active field
and ESC leaves the code as it is exiting the edit mode and returning you to the default code editor mode(hope it makes some sense xD).

You can use it to finish things like:
class, struct, if, while, for, foreach and so on...

Source: Pro C# 2010 and the .NET 4 Platform (page 63 if you happen to have it).


11 August 2011 - 12:30 PM
Found a MSDN reference on the following topic:

Visual C# Code Snippets

Note: Some of the will work only on VS 2010.


11 August 2011 - 02:09 PM
you can also create your own snippets if you find yourself typing the same code block over and over


11 August 2011 - 09:54 PM
i just started using vim and i really like it. i tried using Emacs a while ago but it had me banging my head up against a wall so fast i couldn't stand it. just sayin' Emacs isn't for everyone...


12 August 2011 - 02:44 AM
I just checked it in VS 2008 - works too ;)


12 August 2011 - 07:57 AM
I have always used this with NetBeans (Java), a fori + TAB, expands to a for loop with the 'i' highlighted.
There are many others. The most useful of them is
sout + TAB = System.out.println("");
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

About Me

Posted Image

Bienvenidos! I'm a USA ex-pat living in Bolivia for the past 10 years. Web development is my forte with a heavy lean for usability and optimization. I'm fluent in both English and Spanish. I guest write for the popular Python website Python Central. Visit my website.