Edit

Share via


Manage word wrap in the editor

You can turn the Word wrap option on or off. When enabled, long lines that extend beyond the current width of the Code Editor window continue onto the next line. When disabled, you can scroll horizontally to view the rest of long lines. You can turn this option off to use line numbering.

To set word wrap preferences

  1. Select Tools > Options.

  2. Select Text Editor > All Languages > General to set this option globally.

    — or —

    Select Text Editor > Programming language that you're using, for example, C# > General.

  3. Under Settings, select or clear the Word wrap option.

    When you select the Word wrap option, the Show visual glyphs for word wrap option is enabled.

    Screenshot of the word wrap option in Text Editor Settings.

    Note

    The Show visual glyphs for Word Wrap option displays a return-arrow indicator where a long line wraps onto a second line. These reminder arrows are not added to your code. They are for display purposes only.

To indent word wrap

Starting with Visual Studio 17.13, you can choose whether wrapped lines in the editor should be indented.

To change word wrap indentation:

  1. Go to Tools > Options > Text Editor > General.
  2. Under Display, select or clear the Automatically indent when word wrap is enabled option.

By default, word wrap indentation is enabled. If you prefer your wrapped lines not be indented, simply uncheck this option. Use this setting to help improve readability and maintain the desired formatting of your code.

Known issues

If you're familiar with word wrap in Notepad++, Sublime Text, or Visual Studio Code (VS Code), be aware of the following issues where Visual Studio behaves differently to other editors:

Features of the code editor