December 20, 2006

My VS.NET 2005 Bookmark Pet Peeve

Maybe I'm too old school, but I was so comfy and happy with +K, N and +K, P as my "next" and "previous" bookmark keyboard shortcuts in VS.NET 2003 default C# developer profile.

Of course, VS.NET 2005 had to mess up the great bookmark relationship that I had with VS.NET 2003 by making those particular hotkeys default to scanning through my entire solution's files to find the next and previous bookmarks. I think that it goes through every file included in your solution, and in my case that's thousands of files. It takes FOREVER! The problem is, is doesn't do this all the time either. I think VS.NET 2005 has to build a bookmarks index initially for a solution which seems to be a one time occurring thing, but it does happen to me again from time to time.

The other annoying side effect that it does is expands your entire solution explorer folder / file structure. So all folders & code behinds & besides & designer files & resource files etc. become expanded. Can you imagine what a pain in the arse it is to navigate through the mess it causes and clean it up! A quick fix I do for that sometimes is just to close VS.NET 2005, delete my .suo solution options file, and re-open - all the files and folders are again neatly collapsed.

Thankfully with the use of keyboard shortcuts in VS.NET 2005 you can change your hotkey mappings for bookmarks. Go to Tools -> Options, and under Environment -> Keyboard, and modify these settings:
Edit.NextBookmark
Edit.NextBookmarkInDocument
Edit.NextBookmarkInFolder
Edit.PreviousBookmark
Edit.PreviousBookmarkInDocument
Edit.PreviousBookmarkInFolder

You'll be glad you changed your bookmarks settings especially if you have several hundreds or thousands of included files in your solution.

0 comments: