July 2006

Visual Studio Keyboard Tip #3 - Formatting

To automatically format your code in Visual Studio 2005 use the following keyboard shortcuts:

Format Document: CTRL + E, then D
Format Selection: CTRL + E, then F

If you have any syntax errors in your code then the formatting features do not seem to work. So, if you are trying to use the keyboard shortcuts to format a document and it doesn’t seem to be working, then check your code.

The formatting engine is great. You are also able to customize what the format style you want to use for each language you work with. Go to the Tools menu, click Options. Select Text Editor, then the language, for example C#. Expand the node in the tree (C# in this case) and you’ll see either a Format or Formatting child node. Once you select that you’ll see the options available to you.

visual studio
keyboard

Comments (1)

Permalink

Great Windows FTP Client

I originally found the link to SmartFTP on Scott Hanselman’s blog post listing what tools he installs on a freshly paved machine — thanks Scott!

This is the best FTP client I’ve used and it’s free!

tools

Comments (0)

Permalink

How to script changes to your TCP/IP setting in WindowsXP

Microsoft created a cool scriptable utility called netsh. that allows you to make changes to your TCP/IP settings very simply. To try it out, open a command prompt and enter the following:

netsh

You should see the prompt change to netsh>. Next, enter this command:

help

You should now see the list of all the commands you can use. Now enter:

interface

You should now see the prompt change to netsh interface>. That means you are now executing commands in this context. In each context you can type help to see what commands are available. Next type:

show interface

You should now see a list of all the network interfaces on your machine. What’s cool is you can put a statement like this into a batch file to automate setting changes:

netsh interface ip set dns name=”Wireless Network Connection” static X.X.X.X primary

Where X.X.X.X is the ip address that you want to set as the primary dns for the network connection named “Wireless Network Connection”. I have found this very helpful when used to automatically configure settings for a VPN connection.

windows

Comments (0)

Permalink

Visual Studio Keyboard Tip #2 - Bookmarks

Bookmarks are one of the features of Visual Studio that if you are currently using them take the time to read this tip, they really are that cool.

The keyboard shortcuts to utilize the bookmark feature makes use of “chords”, which are a repeated sequence of keys, the first to select the group of actions and the second to perform the action.

  1. Open a new text file in visual studio.
  2. On the first line type “Here is some code”.
  3. Enter CTRL + K then CTRL + K again. You should now see a bookmark indicator in the left margin of the line.
  4. Hit enter a few times.
  5. Then type “Here is some more code.”. Now create another bookmark by pressing CTRL + K, then CTRL + K again.
  6. Press CTRL + K, then CTRL + N. You should now see that you have navigated to the first bookmark. Enter CTRL + K, then CTRL + N again. You’ll cycle through the bookmarks you have set. Pretty cool, huh?
  7. But wait, you say! Now I have these little blue things in the left margin of my code, how do I get rid of them. Pretty easily, you can remove bookmarks just the way you set them. Position the caret on the line of the bookmark you want to remove and press CTRL + K, then CTRL + K again.

I have found bookmarks to be incredibly useful when coding and hope you do to. In Visual Studio 2005 there are new keyboard shortcuts for bookmarks, although the old ones work as well:

Toggle Bookmark: CTRL + B, then T
Next Bookmark: CTRL + B, then N

visual studio
keyboard

Comments (0)

Permalink

Visual Studio Keyboard Tip #1 - Delete Line

From any position on a line you can delete it by pressing:

CTRL + L

This deletes the entire line and positions the caret at the beginning of the line.

visual studio
keyboard

Comments (1)

Permalink