in

Platinum Bay

Peace, Love and Visual Studio Team System

.NETicated

Bookmark This

The bookmark window is something of a red-headed step-child in Visual Studio. No real developer would be caught dead using bookmarks, right? I mean, it makes hoping around large projects so much easier. Therefore it must be cheating, right? I am here to tell you that it is o.k. to use bookmarks. In fact, you should be using bookmarks. Here's why.

Say you have a large project with a dozen or so solutions and hundreds of thousands of lines of code. Remembering where each and every function is or in what section a logical flow takes place, especially after that two week vacation, can be a little numbing. Further, you may be trying to enhance a large project, with areas you want to modify all over the place. You may also just want to easily jump back and forth between certain places in the code. Enter bookmarks.

Bookmarks are more than just place markers in your code; they can be named, categorized and organized. And they come with keyboard shortcuts and a tool window to make them oh so easy to use. Just use the keyboard commands to automatically jump around to specific areas in your code.

Unlike breakpoints, bookmarks can be set (Ctrl+K+K) on any line in the code file, even if the line is blank. You can also name your bookmarks to anything you like to make them easier to remember. Then you can use the keyboard to navigate through the shortcuts (Ctrl+K+P, Ctrl+K+N). Like breakpoints, however, you can enable or disable individual, groups of, or all bookmarks.

Folders allow you to group related bookmarks which allow you to find them easier. They also let you use the keyboard commands to navigate through bookmarks only within the current bookmark folder (Ctrl+Shift+N, Ctrl+Shift+P).

Bookmark Gotchas

There are a couple of gotchas with bookmarks.

  • Bookmark folders cannot be nested, so no organizational hierarchy.
  • The bookmark metadata is stored in the solution user options (.SUO) files, so they won't be automatically checked into source control (TFS, VSS, etc.) to be passed around to your team.
  • You cannot change the icon for bookmarks to give them a more descriptive visual meaning.

Bookmark Keyboard Shortcuts

Lastly, here is a simple list of bookmark keyboard shortcuts, along with some helpful hints to help you remember them.

Description

Shortcut

Hint

Go to Bookmark Tool Window

Ctrl+K+W

Window

Toggle a bookmark on the current line

Ctrl+K+K

bookmarK

New Folder (Bookmark Tool Window must have focus)

Ctrl+K+F

Folder

Move the caret position to the previous bookmark.

Ctrl+K+P

Previous

Move the caret position to the next bookmark.

Ctrl+K+N

Next

Move the caret position to the previous bookmark in the current Folder.

Ctrl+Shift+K+P

Same folder Previous

Move the caret position to the next bookmark in the current Folder.

Ctrl+Shift+K+N

Same folder Next

 

Published Dec 19 2007, 05:45 PM by Steve
Filed under: ,

Comments

No Comments

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews has been working as a developer for more than 8 years. During this time, he has designed and developed applications in such widely varying areas as trust accounting, medical information management, supply chain management, and retail systems. He has firsthand developer experience with a variety of languages, including Java, VB, and .NET. Most recently, he has been immersed in SharePoint. He is currently employed at RDA Corporation in Philadelphia, PA, as a Software Engineer and a team member in the Architectural Guidance evangelism team. Steve is also an MTCS (x2), ICSOO, and .NET fanatic.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.