Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Visual Studio shortcut keys be used in Android Studio?

I am very familiar with the Visual Studio IDE, and am new to working with Android Studio. Is there a way to configure Android Studio so that the keyboard shortcuts that I'm used to from Visual Studio can be used in Android Studio?

like image 441
CJBS Avatar asked Jul 25 '14 19:07

CJBS


People also ask

How do I use shortcuts in Visual Studio?

Keyboard shortcuts in Visual Studio No matter which profile you chose, you can identify the shortcut for a command by opening the Options dialog box, expanding the Environment node, and then choosing Keyboard. You can also customize your shortcuts by assigning a different shortcut to any given command.

How do I assign keyboard shortcuts in Visual Studio?

On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.


1 Answers

Yes, this is possible.

For newer Android Studio Versions

This approach works on at least Android Studio v1.3 and later (per @Dazzibao's comment)

From the menu, select File | Settings. Select the Keymap option on the left, then from the Keymaps drop-down, select "Visual Studio". The defined shortcuts are then updated to Visual Studio settings.

Further customizations are able to be made, and applied. To export these settings, from the menu, choose File | Export Settings, and then select Key Maps, select a file, and save. These can be restored via File | Import Settings in the same way.

Note: Many of the shortcut keys that I was used to using C# are not set to be the same values using this method. Try the second approach (below) if not satisfied with Android Studio's "Visual Studio" key map assignments.

For older Android Studio Versions

The same approach has been documented here for the IntelliJ IDE, and also works for Android Studio. It involves downloading a .jar settings file intended for Resharper users, and importing it into Android Studio.

  1. Navigate to: https://github.com/hhariri/Tidbits/blob/master/resharper.jar
  2. Click "View Raw" to download the resharper.jar file
  3. In Android Studio, import the settings: File -> Import Settings -> <fullPathTo>/resharper.jar

Keyboard shortcuts are now as they would be in Visual Studio. For example, from the Run menu, review the debug control flow shortcuts:

enter image description here

like image 136
CJBS Avatar answered Oct 22 '22 14:10

CJBS