views:

173

answers:

4

In various projects there's certain parts I will keep jumping to.

Is there a way to effectively "bookmark" these parts so I can quickly jump back to a certain line in a certain file (or a certain method)?

I keep getting lost navigation the solution or doing a "find in whole project/solution", and if anyone knows a way then us lot will somewhere.

A: 

I literally thought of a way of doing this as I clicked post!

I could use the TODO feature, adding my own custom prefix of "BOOKMARK", or "BM" if I'm going to be lazy.

joshcomley
use built-in bookmarks instead. it will keep you from unnecessary code modification.
Andrey
+13  A: 

In Visual Studio, you can set markers in the code.

To jump between Markers:

Ctrl + K + N (for next)

and

Ctrl + K + P (for preivous)

To set a new marker

Ctrl + K + K

j0rd4n
That's super - is there a way to label them and look them up? Or are they designed as a temporary thing?Also, is there a way to jump between breakpoints?
joshcomley
Unfortunately, you can't label markers. There might be a plug-in that does it, but I'm not sure. I'm unaware of a keyboard shortcut to jump between breakpoints.
j0rd4n
Did you make it look like that, or did SO detect a key combo being shown?!
joshcomley
I think John Nolan updated it to use images instead.
j0rd4n
how did you do to make it look like that, it is not an image
pablito
I think he pasted it from this link (which just uses HTML tables): http://www.codinghorror.com/blog/archives/000315.html
j0rd4n
+4  A: 

Yes, press the hotkey combination ctrl + k, k (thats ctrl and k, followed by another k) to toggle a bookmark.

then you can do ctrl + k, n for next bookmark and ctrl + k, p for previous bookmark

works like a charm!

Makach
A: 

Go to View | Toolbars and check the Text Editor toolbar so it shows up. It has toolbar buttons to Toggle (create/delete) a bookmark on the current line Ctrl-B, T, as well as navigation to the next/prev bookmark, where the navigation is scoped to the solution, folder, or document, depending on which button you use.

Once you have a bookmark created, go to View | Other Windows and select the Bookmark Window (or just press Ctrl-W, B). That will display the list of all the bookmarks. You can double-click any bookmark to jump to it, or use the toolbar button in the Bookmark window for prev/next.

You can also name/rename your bookmarks in the Bookmark window. Right-click on the name and choose rename, or select the name and click it again to enter in to the edit mode.