The blog for Design Patterns, Linux, HA and Myself!
In this article, I’ll show you how to use distraction free mode by changing the code alignment in IntelliJ IDEA, GoLand or Pycharm.
In the default configuration, the Code Editor is left aligned.
It is just beside the Project Tab. When the Project Tab is minimized then the Code Editor becomes left aligned. This behaviour is not ideal for everyone and it can be changed by adding a custom VM option.
The steps are following:
Open the Custom VM Options by Searching Edit Custom VM Option.
The Custom VM Options should open.
-Xms128m
-Xmx2029m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf
Add -Deditor.distraction.free.mode=true into the list of present VM options. So, The new content will be:
-Xms128m
-Xmx2029m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf
-Deditor.distraction.free.mode=true
Restart your application.
Now the center alignment should have been applied.