Navigating Code with VS2008

Here are a few keyboard shortcuts in Visual Studio 2008 that I’ve recently (re)discovered:

  • CTRL + - Move to the last position in code.
    This is very helpful if you’ve been jumping through a file while searching for a particular function, variable, whatever.
  • CTRL + SHIFT + - Just like the above, but in reverse.
    This moves forward through code, if any forward position is available. Otherwise you’ll just wonder why you’re pressing CTRL + SHIFT + – over and over.
  • CTRL + K, CTRL + K Add a new bookmark.
  • CTRL + K, CTRL + N Move to the next bookmark in the file.
  • CTRL + K, CTRL + P Move to the previous bookmark in the file.
  • CTRL + K, CTRL + L Clear bookmarks
  • CTRL + K, CTRL + C Comment line(s).
    Comment out the current line or selected lines. Take note, this will not put a comment at the beginning of empty lines, which drives me nuts.
  • CTRL + K, CTRL + U Uncomment line(s).

The bookmark functionality is great when you’re focusing on refactoring several common code blocks that have subtle differences and you want to make sure you account for all edge conditions when you’re combining them into a single method.

Comments

One Comment so far. Leave a comment below.
  1. For more VS Tips, purchase Sara Ford’d book. All profits go to the Hurricane Katrina relief effort.

Add Your Comments

Disclaimer
Your email is never published nor shared.
Required
Required
Tips

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <ol> <ul> <li> <strong> <p>

Ready?

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 226 items have been purified.