67

I don't know why but sometime in Android Studio Editor, it shows vertical line as shown in screenshot below.

Don't know about other editor but it happens in Android Studio.

So why it is showing and how to hide it?

Android Studio shows Vertical Line in Editor

Jagruttam Panchal
  • 3,152
  • 2
  • 15
  • 21

4 Answers4

144

That line historically represents the margin of A4 paper, which is useful only if you need to print the code. Old school says that you should keep your code inside that margin, to guarantee much portability.

But.. nowadays in the real life, it makes no sense to me! Because we always use advanced editors, bigger displays, and I never needed to print any single line of code.

So, if you want to do it:

Newer versions

Editor -> General -> Appearance -> Show hard wrap guide

Older versions

Editor -> General -> Appearance -> Show right margin

or

Editor -> Appearance -> Show right margin

For Mac

To remove line go to:- Preference-> Editor -> General -> Appearance -> Show hard wrap and visual guides. Uncheck it to remove.

Hardik
  • 373
  • 2
  • 14
Luca Corradi
  • 2,031
  • 1
  • 16
  • 17
  • 3
    for me it's indicated as "Show hard wrap guide" – Ivo Apr 19 '18 at 09:33
  • Updated the answer with @IvoBeckers suggestion – Luca Corradi Jun 26 '18 at 10:47
  • 8
    One and a half year late to the party but since this is a somewhat popular question I'd like to ad something. Whenever you go past this line there is a way to clean up your code and make it more readable. It's good practice to not cross this line, at leas not by many characters since it really is not needed if you properly refactor and layout your lines of code. You will do your future self and others reading your code a huge favor. – Madmenyo Sep 12 '18 at 13:42
  • 2
    I´m not familiar with the historical origin you mention. The current objective of that line is to keep lines to a conventional readable length. – cutiko Nov 22 '22 at 11:19
17

It is as follows in the newer version of Android Studio:

Editor -> General -> Appearance -> Show hard wrap guide

theThapa
  • 581
  • 4
  • 11
5

im Mac

Open Android Studio and Click

cmd + ,

and follow this step:

enter image description here

q8yas
  • 897
  • 8
  • 10
1

Android Studio has changed layout again, so you can find this option at:

File -> Settings -> Editor -> General -> Appearance -> Show hard wrap and visual guides

As it is mentioned earlier, if your code is of that length, it is pretty obvious that it is not that readable, i.e. clean. Being old school, I keep it at 80 characters and spill occasionally.

Viktor Brešan
  • 5,293
  • 5
  • 33
  • 36