devoured elysium devoured elysium - 1 year ago 60
C# Question

Using code snippets in Visual Studio

Right now when I want to use the

snippet (Code snippet for
). I am typing
, Tab, Tab.

Is this the correct (fastest!) way of doing it?
If there wouldd be some way of only having to hit the tab key once or any other key I would be glad to know it.

Answer Source

That is the fastest way. Note that the first tab is just to get rid of the IntelliSense tooltip. The second tab is the one that actually does the work. In other words, you can do cw + esc/tab/enter + tab or even c + esc + w + tab. Or you can even type cw, go somewhere else, click right after the cw then tab and it will auto complete.

That could be annoying if you do something like var cw tab.

Edit: Once you have used "cw", you can then do it a bit faster by just typing c + tab + tab. Since you last used "cw", the c will select "cw" from IntelliSense, the first tab will insert it, and the second tab will auto complete.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download