jelmood jasser
jelmood jasser

Reputation: 918

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

Upvotes: 5

Views: 5123

Answers (1)

Aurélien Guelle
Aurélien Guelle

Reputation: 198

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.

Upvotes: 13

Related Questions