简体   繁体   中英

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM