I would like to know how to turn off Android Studio
's auto-formatting?
For some reason blank lines are always devoid of tabs or spaces, regardless of the scope or what so ever. Even if I manually place tabs in there, in a few moments they are gone. Its so annoying I always have to always press tab before writing code. It may be possible that this could be happing because I am using an older version of the program. But I am even unable to upgrade (a problem for another day, not today). So if anyone has a solution to this please share? Thanks in advance.
You can change the formatting style under File>Settings>Editor>Code Style>Languages .
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. Switch to the Formatter tab and enable the Turn formatter on/off with markers in code comments option.
Navigate to the file in which we have to format our code and then click on the shortcut key as Ctrl+Shift+Alt+L after clicking this key you will get to see the below dialog on your screen. Select the formatting options and your code will be formatted and rearranged according to selected options.
Just go to File>Setting>Save Actions and turn off all actions. Hit apply and you are good to go. See the picture for more info.
You can turn off most of the meddling with your text formatting in the menu...
Settings->Editor->General->Smart Keys
...and then untick as many things as possible.
I have not found a simple 'Just leave what I type alone' option.
You can change the formatting style under File>Settings>Editor>Code Style>Languages
.
Edit:
Click on the Language you want to change the formatting. You can see the the different tab to to change the spaces and lines.
Note:
screen shot taken on Android Studio 1.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With