Code formatting shortcut in Android studio

I have started developing with Android Studio. In eclipse I was using Ctrl+Shift+F but in Android studio it does not work, It will be different.

How can I jump to any method in .java . I was using Ctrl+O in eclipse.

Is it available? Can any one tell me that shortcut for code formatting?


Win

Ctrl + Alt + L

Linux:

Ctrl + Shift + Alt + L

Mac:

Option + Command + L

Reference : Key Commands and here is full commands for Windows/ Linux users and for Mac users


Update for Ubuntu As Rohit faced the problem in Ubuntu to format code shortcut, because the Ctrl + Alt + L key is used to lock the screen in Ubuntu.

I found that Ubuntu which handles the key event first. So try to change the Ctrl + Alt + L action in Ubuntu just to be sure.

Steps are :-

Go to System Tools -> System Settings -> Keyboard -> Shortcuts Tab -> System -> Lock Screen

Select the row New Accelerator... will be visible then press any Special key with Alpha key (like Shift + L). You changed the key shortcuts.

Now check format key in Studio.

Alternatively

Ctrl + Alt + Shift + L (for a dialog)


Update came from Henry Chuang, and also in another answer given by user2340612.

You can also use Eclipse shortcuts. Windows and Linux, go to File > Settings > Keymap , Mac OS X, go to > Preferences > Keymap and choose Eclipse from the dropdown menu.


You can also use Eclipse's keyboard shortcuts: just go on preferences->keymap and choose eclipse from the dropdown menu.

EDIT

The actual path is: File->Settings->(under IDE settings)->Keymap (thanks to @Dhinakaran Thennarasu)


Check Keyboard Commands given in the Studio Tips & Trick documentation.

在这里输入图像描述

链接地址: http://www.djcxy.com/p/49354.html

上一篇: Android Studio快捷方式,如Eclipse

下一篇: Android studio中的代码格式化快捷方式