2 Rider shortcuts you need to be using

Increase your test productivity with fluent style tests.

This article covers two essential Rider keyboard shortcuts that will help you out in your development workflow. Whether you are an experienced user or completely new to Rider, this article has something interesting for you.

Learning shortcuts is probably one of the most useful things you can do to increase your coding efficiency. However, learning, remembering, and using them is rather dull. Luckily Rider has some powerful context-sensitive shortcuts which you can get to everywhere else and start to learn other keyboard shortcuts—allowing you to move around and work with your code quicker without a cheat-sheet.

Goals of this Article:

Boosting your productivity with a limited set of shortcuts in the following areas:

  •          Search / Navigation
  •          Context-sensitive actions (refactoring, navigating, code-generation)

Let’s go ahead and learn how to be productive with Rider shortcuts!

Search and Navigation

Being able to navigate through your projects is essential. Rider has a lot of menu items; however, my advice is to ignore all of those and stick with the main shortcuts.

Rider shortcuts # 1: search like an expert with Double-Shift

I’m going to show you the first essential keyboard shortcut: Double-Shift. Pressing Shift-Shift will open the search everywhere dialog. The search everywhere dialog is very powerful and offers many features to get anywhere you need to go.

Note: You might already use a different keyboard shortcut, Ctrl+T or Ctrl+N, But I will suggest using double-shift. Not only is this a very convenient shortcut, but it’s also a common keyboard shortcut over all keymaps and all JetBrains products.

So, whereas once we call double-shift, the search everywhere dialog will appear. You can hit Tab to narrow down searches based on classes, files, symbols, and action.

When searching, you don’t have to type everting out either. You can use short versions of the words, as shown below.

rider-search-dialog-1
Riders search everywhere dialog

Or provide the initial letters of multi-word symbols (camel humps)

rider-search
Searching using camel humps

There are a couple of other useful things you can do within the search everywhere dialog, for example, type the line number. This option is handy is you have a log message which is pointing to a particular line.

Context-sensitive actions

Rider shortcuts # 2: Alter, Refactor, and generate code with ease.

Alt-enter in a context-sensitive shortcut and will allow you to perform relevant actions based on the position of your cursor. This is done by showing an action menu as visible in the image below.

Riders Action List (with line indicator)

Alt-enter Is extremely useful for when we are dealing with inspections on the go, however, alt-enter is available everywhere and not limited to lines marked with an ‘action’ indicator.

But what are inspections? Inspections detect and highlight code issues in design time. There are a lot of inspections available in Rider. Some identify bugs, and others cover coding styles. More about indicators can be found within the documentation.

The actions menu starts with specific context actions at the top and ends with generic actions at the bottom. While the action list is displayed, you can start typing to find and execute any of the available actions and search through settings. Let’s look at an example; Generating a constructor.

Alt-enter and select Generate Code…
The refactor actions menu

After a while, you might find navigating to the generic action items (navigation, refactor, and core generation) somewhat cumbersome. At this point, you can start using more specific shortcuts like Alt-insert, Alt-` etc.

Conclusion

Now you know about more about the most powerful keyboard shortcuts available in the JetBrains Rider IDE. By remembering only a limited set of five rider shortcuts, you can explore and alter code without having to touch the mouse, allowing you to be more productive and start to learn other keyboard shortcuts during the process.

Post Navigation