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.
This is Jeremiah
I live in Portland, OR. I have two dogs.
I recently received a Master's of Science in Computer Science from Portland State University.
I'm was Microsoft MVP from 2009 - 2018 with a pile of certifications. Somewhere along the way, I wrote a database client for Riak and then handed it off to the community.