For you custom navigation needs,
ReSharper provides a way of marking code lines with bookmarks and navigating between them.
There are two types of bookmarks:
Numbered bookmarks
- you can toggle each bookmark of this type and navigate to each of them with
the dedicated shortcut:
Ctrl+Shift+<digit>
toggles the corresponding bookmark;
Ctrl+<digit>
navigates to the corresponding bookmark.
You can have up to 10 numbered bookmarks simultaneously.
Anonymous bookmarks
- these bookmarks can be only toggled and navigated from the
bookmarks pop-up. You can have unlimited number of these bookmarks.
Bookmarks are displayed in the left part of the editor
, on the
action bar
.
Numbered bookmarks have small numbers, unnumbered bookmarks have solid fill.
Here is how a numbered bookmark #3 looks like:
Note that bookmark icons do not react on mouse clicks.
To operate on bookmarks, use the corresponding shortcuts or menu commands.
To add a numbered bookmark, press
Ctrl+Shift+<digit>.
If this number is occupied by another bookmark, it will be replaced.
Both numbered and unnumbered bookmarks can be added with the bookmarks pop-up as described below.
To add a new bookmark
Place the caret at the code line you want to mark.
Press
Ctrl+~
or choose
ReSharper | Navigate | Bookmarks | Bookmarks…
in the main menu
.
The bookmarks pop-up will appear:
In this pop-up, you will see all bookmarks, if any, that are set in the current solution.
Do one of the following:
To create a numbered bookmark, select a numbered item and press
Insert.
To create an unnumbered bookmark, either click the
New anonymous bookmark
item, or select this item and press
Insert.
A bookmark is added and the corresponding icon appears to the left of the current line in the editor.
To go to a numbered bookmark, press
Ctrl+<digit>.
To go to a numbered or an unnumbered bookmark, you can use the bookmarks pop-up as described below.
To navigate to a bookmark
Press
Ctrl+~
or choose
ReSharper | Navigate | Bookmarks | Bookmarks…
in the main menu
.
In the bookmarks pop-up, click on a bookmark you want to go to or
select this bookmark and press
Enter.
ReSharper will open the corresponding document and set the caret at the line where the bookmark is.
To remove bookmarks
To remove all bookmarks in the solution, choose
ReSharper | Navigate | Bookmarks | Clear All Bookmarks
in the main menu.
To remove all bookmarks in the currently opened document, choose
ReSharper | Navigate | Bookmarks | Clear All Bookmarks in Document
in the main menu.
To remove a numbered bookmark,
Ctrl+Shift+<digit>.
To remove a numbered or unnumbered bookmark, choose
in the menu or press
Ctrl+~.
In the bookmarks pop-up, choose a bookmark thet you want to remove and press
Delete.
This feature is
supported
in the following languages/technologies:
The instructions and examples given here address the use of the feature in C#.
For details specific to other languages, see corresponding topics in the
ReSharper by Language
section.