Condividi tramite


Setting Bookmarks

Keyboard:  CTRL + K, CTRL + K (toggle bookmark)
Menu:  Edit -> Bookmarks -> Toggle Bookmark
Command:  Edit.ToggleBookmark
Versions:  2008,2010
Published:  7/5/2010
Code:  vstipTool0047

 

Bookmarks are a pretty cool feature that a lot of people don't seem to know about.  Essentially, Bookmarks are a way to mark locations in your code.  Unlike tokens ("TODO's"), Bookmarks are not stored with the source code.  There are numerous ways to set a Bookmark.  The simplest way is to use CTRL + K, CTRL + K to create a single Bookmark:

image

 

When you set a Bookmark it will create a glyph in the Margin and create an entry in the Bookmarks Window:

image

 

The good news is you don't have to keep the default name that is given for the Bookmark.  Just RIGHT CLICK the entry in the window and choose "Rename":

image

 

Then put in whatever you want for the name and you are good to go:

image

 

You can continue to use this method or the menu to create Bookmarks.  Another cool way to create Bookmarks is to use the "Bookmark All" (bottom right) button in the Quick Find dialog (CTRL + F):

image

Comments

  • Anonymous
    July 04, 2010
    "Bookmarks are pretty cool", ....well they are ok. If you work in a team, they don't always work perfectly.... For example, if a team member has their Project folder on the C drive and another team member has their Project folder on a D drive, then bookmarks will have issues. Bookmark not found. Look at your Image at "When you set a Bookmark it will create a glyph in the Margin and create an entry in the Bookmarks Window"  your location is C:WindowsAzure Now.. what if you want to work on another system say at home, or clients etc... Anyone have a suggestion or workaround ? BTW I still use them. Have a great day :)

  • Anonymous
    July 05, 2010
    Since Bookmarks aren't stored with the source the general consensus is to not use them for team activites but rather use comment tokens ("TODO"'s) instead.   Z

  • Anonymous
    February 27, 2011
    In my Visual Studio 2008, I have bookmark options on the text editor, but no bookmarks menu available.

  • Anonymous
    February 27, 2011
    Are you saying that you don't see the Bookmarks submenu off the Edit Menu?

  • Anonymous
    March 18, 2011
    i m nt able to  set bookmarks using edit-> bookmarks....... giv me another option plz..nt even ctrl+k is working in ma visual studion 2008

  • Anonymous
    June 18, 2011
    I am using Visual Studio 2010 Express, I am not able to bookmark through menu or no option is available in Toolbar.. though Ctrl+K,Ctrl+K is working, am not able to move from one bookmark to another..  Please give the key shortcut for that..

  • Anonymous
    June 18, 2011
    Ctrl+K,N  and Ctrl+K,P  are shortcuts for moving to next and previous bookmarks.. Thanks..

  • Anonymous
    March 20, 2012
    ....am not able to bookmark through menu or no option is available in Toolbar.... you need to change tools  >settings > basic settings X to tools > settings > expert settings X then you will be able to see the bookmarks menus and toolbar

  • Anonymous
    April 30, 2012
    Another cool tip would be suggestions on how to replace the glyph used for bookmarks with something that stands out a little more.  Is there an image file that can be replaced?

  • Anonymous
    April 30, 2012
    Hey Les :) Sadly no.  There currently is no way I am aware of to replace the glyph for bookmarks. Z

  • Anonymous
    September 03, 2012
    Numbered bookmarks would be really nice, e.g., Ctrl-K,Ctrl-K,1 then go back to that one with Ctrl-K,Ctrl-N,1.  Easy for 0..9. Not as easy as the single keystroke solution Embarcadero offers but still nice.

  • Anonymous
    September 04, 2012
    Rhys, Yeah I would definitely like to see more work done on the usability of bookmarks.  I think they offer much more than people realize and can be a powerful piece of the experience. Z

  • Anonymous
    October 23, 2012
    Are bookmarks supposed to save on close (or in any other fashion)? I've tried using bookmarks, but every time I restart VS(2008), the bookmark window is empty again. I'd love to use them systematically, but without saving, they're utterly useless :/.

  • Anonymous
    April 25, 2013
    Why don't you just use relative paths for the bookmarked code? It could be relative to the .sln file, so everyone could use it, no matter if you have your code on drive C: or D: or whereever.

  • Anonymous
    May 05, 2013
    Hey Michael, I honestly don't know why relative paths aren't used. It makes sense to use them (or at least have an option to use them). Z

  • Anonymous
    September 24, 2013
    The comment has been removed

  • Anonymous
    October 13, 2013
    The comment has been removed

  • Anonymous
    January 20, 2014
    The comment has been removed