- 3 minutes to read
Markers are navigation waypoints which save the important locations in the code to which you can return in the future.
You can configure Markers on the Editor | All Languages | Markers options page. See Marker Settings for more information.
How to Enable
Use one of the following ways:
Open the Configuration Options window and enable the Markers option in the Quick Setup options page.
Open the Configuration Options window, choose the Editor | All Languages | Markers options page, and enable the corresponding option.
Click the Setup Wizard… item in the CodeRush menu to open the wizard (see First Steps for more information) and choose one of the “use markers” options in the Markers wizard page.
Drop a Marker
CodeRush can drop a marker if you enable the Markers feature for the following cases:
When CodeRush expands a template (if one of the marker text commands is inserted into the template expansion code). You need to enable the “Drop markers in templates” option. The following screencast shows the “c” template expansion:
When CodeRush drops a marker before jump after you run one of the Jump To navigation providers, or use the built-in Visual Studio’s Edit.GoToDefinition (F12) or Edit.GoToReference (Ctrl+F12) command. You need to enable the corresponding marker option
CodeRush also allows you to drop a marker. Place the caret in code where you want to drop a marker, and perform one of the following actions:
Press Alt + Home.
Use the CodeRush | Navigate | Drop Marker menu item.
You can also perform one of the actions above to drop a marker onto the selected code.
The sections below describe ways you can use to navigate to the last dropped marker.
Collect a Marker
Place the caret in the code editor and perform one of the following actions:
Press Alt + End.
Use the CodeRush | Navigate | Collect Marker menu item.
CodeRush moves the caret to a marker and removes it. If several markers are dropped, they are collected sequentially starting with the most recent.
You can specify which shortcut CodeRush should use to collect a marker:
Open the CodeRush setup wizard (see First Steps for more information).
Go to the Markers wizard page and choose one of the “Use markers and collect..” options.
Collect a Marker and Paste
This command collects a last dropped marker and pastes clipboard contents in its place.
Place the caret in the editor and perform one of the following actions:
Use the CodeRush | Navigate | Collect Marker And Paste menu item.
Press Shift + Esc.
Swap a Marker
CodeRush can drop a marker and collect the last dropped marker.
Place the caret in code where you want to swap a marker and perform one of the following actions:
- Use the CodeRush | Navigate | Swap Marker menu item.
Press Alt + Shift + Home.
Clear All Markers
Use the CodeRush | Navigate | Clear All Markers menu item to clear all markers simultaneously.
Change Default Shortcuts
Use the CodeRush | Shortcuts… menu item to access the IDE | Shortcuts options page.
Open the Navigation | Markers group, select the command and change the default shortcut for it. See the Shortcuts topic for more information.