Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a possible way to make Android studio format the code?

Is there a possible way to make Android studio format the code automatically without pressing CTRL +ALT+L?

I mean is this option available like the automatic import?

Thank you

like image 998
jelmood jasser Avatar asked Aug 26 '15 15:08

jelmood jasser


1 Answers

There is no way to do that automatically. But you can create a macro that will do it for you.

For example, I changed the short-cut use to save CTRL+S by a macro that format the code then save. It's very usefull when you save a lot.

To do so :

  • Go in Edit/Macro/Start Macro Recording
  • Press CTRL+ALT+L then CTRL+S
  • Edit/Macro/Stop Macro Recording
  • Then change the short-cut of save by your macro in the Settings

Hope that help.

like image 150
Aurélien Guelle Avatar answered Oct 16 '22 20:10

Aurélien Guelle