Back to Devexpress

CodeRush Shortcuts

coderushforroslyn-401983-getting-started-keyboard-shortcuts-coderush-shortcuts.md

latest19.7 KB
Original Source

CodeRush Shortcuts

  • Apr 13, 2022
  • 7 minutes to read

The following tables show the default shortcuts for the main CodeRush features:

Clipboard

FeatureShortcutDescriptionContext
Clipboard HistoryCtrl + Shift + VInvokes the Clipboard History window if the clipboard contains at least two different text fragments. Otherwise, pastes text from the clipboard.The editor is focused.
Smart CopyCtrl + C or
Ctrl + InsertSelects the code block based on the caret position and adds the selected code block to the clipboard.No selection, the caret is on token.
Smart CutCtrl + X or
Shift + DeleteDeletes the code block based on the caret position and adds it to the clipboard.No selection, the caret is on token.

Define Selections

FeatureShortcutDescriptionContext
Selection ExpandCtrl + WIncreases the selection by logical code blocks.The editor is focused.
Selection ReduceCtrl + Shift + WReduces the selection by logical code blocks.The editor is focused.
Select CamelCase LeftAlt + Shift + LeftSelects the left part of words in camelCased and PascalCased identifiers.The editor is focused.
Select CamelCase RightAlt + Shift + RightSelects the right part of words in camelCased and PascalCased identifiers.The editor is focused.

Wrap Selections

You need to enable the shortcuts. Open the CodeRush Setup Wizard, find the “One-key Selection Embedding” page and check “Enable one-key Embedding shortcuts” option.

FeatureShortcutDescriptionContext
Comment/UncommentSlash (/) in C#, JavaScript, TypeScript, F#, XAML, XML, and CSS.
Apostrophe (‘) in Visual Basic, XAML, XML, and CSS.Comments out the selected code or deletes comment delimitersMulti-line selection.
Block begin/endBWraps multi-line selections in the C# brace block {}.Multi-line selection.
try/catchCWraps multi-line selections in the try/catch block.Multi-line selection.
try/finallyFWraps multi-line selections in the try/finally block.Multi-line selection.
try/catch/finallyTWraps multi-line selections in the try/catch/finally block.Multi-line selection.
ParenthesesShift + 0 , Shift + 9Embeds the selection in parentheses.Any selection
Not ParenthesesShift + 1Embeds the selection into the parentheses and places the logical Not (! in C#/C++, Not in Visual Basic) before the parentheses.Any selection.
RegionCtrl + 3Embeds a selection between the #region and #endregion directives and selects the region name placeholder.Multi-line selection.

Code Generation and Refactoring

FeatureShortcutDescriptionContext
Refactor/DeclareCtrl + `Invokes the Code Actions menuThe editor is focused.
Expand TemplateSpace or TabExpands a template.The caret after template.
Cycle Scope UpAlt + UpChanges a member’s visibility modifier.In the member/type declaration
Cycle Scope DownAlt + DownChanges a member’s visibility modifier.In the member/type declaration.
Smart Duplicate Line/SelectionShift + EnterDuplicates a code line and inserts text fields into the duplicate.The editor is focused.
Camel Delete LeftAlt + BackspaceDeletes the camelCase word to the left of the caret.The caret is in the CamelCase token.
Camel Delete RightAlt + DeleteDeletes the camelCase word to the right of the caret.The caret is in the CamelCase token.
Declare ClassCaps + CDeclares a class.The caret is on an undeclared class.
Declare MethodCaps + MDeclares a method.The caret is on an undeclared method.
Declare PropertyCaps + PDeclares a property.The caret is on an undeclared property.
Declare FieldCaps + FDeclares a field.The caret is on an undeclared field.
Declare LocalCaps + LDeclares a local.The caret is on an undeclared local.
Declare ConstantCaps + QDeclares a constant.The editor is on an undeclared constant.
Remove Redundant CodeCaps+DeleteRuns one of the code actions depending on the code context: Remove Block Delimiters, Remove All Redundant Block Delimiters, Remove Redundant Constructor, Remove Redundant Assignment, Remove Variable, and others.The caret is in a redundant type/type member.
Add New CodeCaps+InsertRuns one of the following code providers depending on the code context: Add Parameter, Add Else Statement, Add Getter/Setter, Add Missing Constructors, Add to Interface, and Create Event Trigger.The caret is in a corresponding type member.
Toggle CodeCaps+SpaceRuns one of the following code actions depending on the code context: Make Implicit/Explicit, Use Expression Body, Convert to/Decompose Initializer, Inline Temp, Conditional/Ternary/Coalescing, and other actions.The caret is in a corresponding type member.

Remove Redundant Code Actions

Press Caps+Delete to run one of the following code actions:

Toggle Code Actions

Press Caps+Space to run one of the following code actions:

Note

To use the Caps Lock as a modifier, enable Caps shortcut bindings in the Setup Wizard on the Caps as a Modifier page. To learn caps shortcuts and practice CodeRush features: select the CodeRush | Support | Open Learning CodeRush Solution menu item.

FeatureShortcutDescriptionContext
Tab to Next ReferenceTabHighlights the current identifier and all its references and navigates to the next reference.The caret is inside an identifier.
Tab to Previous ReferenceShift + TabHighlights the current identifier and all its references and navigates to the previous reference.The caret is inside an identifier.
Contextual Jump ToCtrl + Alt + DelInvokes the Jump to window.The editor is focused.
Jump to SymbolCtrl + Shift + QInvokes the Jump to Symbol window.The editor is focused.
Jump to FileCtrl + Alt + FInvokes the Jump to File window.Available anywhere.
Drop MarkerAlt + HomeDrops a marker.The editor is focused.
Collect MarkerEscape or Alt + EndMoves the caret to a marker and removes it.The editor has focus, the marker is dropped.
Swap MarkerAlt + Shift + HomeDrops a marker and collects the last dropped marker.The editor is focused, the marker is dropped.
Toggle BookmarkCtrl + Left Alt +( 1-6 )Drops or removes a corresponding bookmarkThe editor is focused.
Go to BookmarkLeft Alt +( 1-6 )Jumps to a corresponding bookmark.The editor is focused.
Toggle Next BookmarkCtrl + Num+Drops a corresponding bookmark.The editor is focused.
Go to Recent BookmarkCtrl + Num-Jumps to the last bookmark and removes it.The editor is focused.
Camel Case Nav LeftAlt + LeftMoves the caret to the left part of words in camelCased and PascalCased identifiers.The caret is in the camelCase or PascalCased token.
Camel Case Nav RightAlt + RightMoves the caret to the right part of words in camelCased and PascalCased identifiers.The caret is in the camelCase or PascalCased token.
Smart NavigationCaps + Arrow KeysNavigates between adjacent methods, parameters, controls, and properties.The caret is on token.
Smart Navigation SelectCaps + Shift + Arrow keyNavigates between adjacent methods, parameters, controls, and properties, and selects them.The caret is on token.

Debugging

FeatureShortcutDescriptionContext
Toggle Temporary BreakpointAlt + F9Turns the temporary breakpoint on or off at the specified line number in the active file.Debugging, the editor has focus.
Step Into MemberCtrl + Shift + F11Skips unnecessary members while debugging and drills down into the member you choose.Debugging, the caret is in the member reference.
Show Expression ExplorerAlt + DownShows the values of expression parts in the Expression Explorer.Debugging, the caret is inside expression.
Toggle Debug VisualizerCtrl + Alt + DTurns the Debug Visualizer on or off.Debugging, the editor is focused.
Refresh/Evaluate ExpressionCtrl + RForces execution of the expression with side effect in the sandbox.Debugging, the editor is focused.

Test Runner

FeatureShortcutDescriptionContext
Run active testCtrl + T , RRuns test cases at the caret (cursor) location.The caret is inside a test method.
Debug active testCtrl + T , DStarts the debugging of a test case(s) at the caret (cursor) location.The caret is inside a test method.
Run all tests in fileCtrl + T , FRuns test cases located in the current source file.Inside a file containing a test class.
Repeat Last Test RunCtrl + T , LRuns test case(s) that were previously executed or debugged.Available anywhere.
Show Unit Test RunnerCtrl + T , TShows the Unit Test Runner tool window.Available anywhere.

You can also download CodeRush Cheat Sheet if you prefer to have a printable copy of CodeRush shortcuts.