Home > Enterprise >  How to remove this gray line that causes text to wrap in VS Code?
How to remove this gray line that causes text to wrap in VS Code?

Time:01-17

I've recently noticed that when typing out long lines of code, they split into multiple lines after this threshold and it bothers me. enter image description here

Not sure if it was a formatting extension that I put on here years ago, but I couldn't seem to locate it in the settings.

CodePudding user response:

The grey line isn't what causes the wrapping. You can apply settings to have the grey line and not have wrapping. They grey line is displayed according to the editor.ruler setting.

In general text editor terminology, this wrapping you are observing is called "soft wrapping" (when an editor wraps long lines in its rendering of the text, but doesn't actually insert line-break characters, which is called "hard wrapping").

By default, soft-wrapping can be toggled by Alt z (The command palette command is named View: Toggle Word Wrap).

The default setting of soft wrapping for VS Code is configurable by the editor.wordWrap setting. It has several values it can take on:

  • "bounded": lines wrap at the minimum of viewport width and editor.wordWrapColumn,
  • "off": Lines will never wrap
  • "on": Lines will wrap at the viewport width
  • "wordWrapColumn": Lines will wrap at editor.wordWrapColumn

The word wrap column is configurable by the editor.wordWrapColumn setting. See also the editor.wrappingIndent and wrappingStrategy settings.

CodePudding user response:

This is a setting called rulers. Go into Settings and search "rulers". Then you will be able to edit the settings.json file. Under "editor.rulers" remove all values in the array so that it is empty. That should solve it.

  • Related