简体   繁体   中英

What is the best way to bookmark positions in code in Visual Studio 2008/2010?

I find myself going to about five or six main places in my code 80% of the time and would like a way to go to them fast even if all files are closed.

I would like to be able to open up a solution in Visual Studio and without any files open , see a list of self-labeled bookmarks like this:

  • LoadNext
  • Settings page refresh
  • app.config connections
  • app settings
  • stringhelpers top
  • stringhelpers bottom

I click one of these and it opens that file and jumps to that position.

How can I best make bookmarks like this in Visual Studio 2008/2010?

Use task list shortcuts:

  1. On a line in text editor use keys (ctrl + k, ctrl + h) this will add a task list shortcut.
  2. Open task list tool window.
  3. In task list tool window select "short cuts" in the drop-down list.

The task list will the show a list of lines where you made a task list shortcut, whit the text from that line.

Why not use the Bookmarks feature? I have the Bookmarks window at the bottom of my Visual Studio window, collapsed. You can view this by going to View -> Other Windows -> Bookmark Window (in VS 2008, anyway).

You can add a bookmark to any line of code; it will then appear in the Bookmarks window. You can then rename the bookmark to whatever you want. It doesn't matter if the file is open or not.

I'm assuming you want this on a per-solution basis rather than a generic set of bookmarks that know how to find a particular type of file. The approach above would seem to be what you want. It seems like Visual Studio remembers a set of bookmarks for each solution; I guess they're stored in the .suo file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM