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