Skip to content

Tip 2.42: How to change default values and variables in a code snippet

February 9, 2014

“Visual Studio Tips, 251 ways to improve your Productivity, in Visual Studio“, courtesy of ‘Sara Ford’

Sara Ford’s Blog

When you insert a code snippet, the editor highlights the fields (variables, values, and so on) you can modify depending on how the code snippet was written. The idea is you modify the contents of the field and then press Tab to navigate to the next field. When you press Tab, that particular field is updated throughout the entire snippet. You can also navigate outside the field via the arrow keys to invoke the update.

If you press Enter, however, you will be committing both the current change (if any) and the entire snippet, meaning you can’t use undo to get back to those highlighted fields. You would have to use your favorite refactoring method to make any additional updates.

Happy Programming! =)

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: