Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Centre code in Android Studio/IntelliJ IDEA editor

I would like to centre my code in the Android Studio's/IntelliJ's editor, like as it is done in the Distraction Free Mode.

Right now, it is always aligned on the left side of the editor, but I want to have it in the centre of the window. I could not find any option for this in the settings. Is this possible without entering the Distraction Free Mode?

like image 296
Stephan Avatar asked Jun 28 '17 07:06

Stephan


People also ask

How do I center code in IntelliJ?

mode=true in Help | Edit Custom VM Options and restart the IDE. This will center the editor without the other features of the distraction free mode (like hidden tool windows).

Can I use IntelliJ IDEA for Android Studio?

Are Android Studio projects compatible with IntelliJ IDEA? Yes, the two IDEs use the same project format.

Which is better IntelliJ IDEA or Android Studio?

IntelliJ IDEA supports development for multiple platforms, but is missing some of the specialized features included in Android Studio, such as APK support. Android Studio may be a better choice for businesses that develop primarily Android Applications.

How do I open code editor in IntelliJ?

In the Project tool window, right-click a file and select Open in Right Split from the context menu (or press Shift+Enter ). IntelliJ IDEA will open a file in the split on the right of the editor.


2 Answers

Add -Deditor.distraction.free.mode=true in Help | Edit Custom VM Options and restart the IDE. This will center the editor without the other features of the distraction free mode (like hidden tool windows).

like image 200
CrazyCoder Avatar answered Sep 30 '22 16:09

CrazyCoder


You can also activate this option through the registry:

  1. Type shift shift to search everywhere
  2. Type registry and select "Registry..."
  3. Type distraction to filter the list
  4. Check the box for "editor.distraction.free.mode"
  5. Close the registry

Voilà, no restart needed.

like image 38
David Palita Avatar answered Sep 30 '22 16:09

David Palita