Bhavesh Hirpara Bhavesh Hirpara - 1 year ago 143
Android Question

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

. I was using Ctrl+O in eclipse.

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

Answer Source


Ctrl + Alt + L


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 handle 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.


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 sortcuts. Windows and Linux, go to File > Settings > Keymap , Mac OS X, go to > Preferences > Keymap and choose eclipse from the dropdown menu.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download