| Tutorials | Visual Studio Code |

How to Enable and Disable Word Wrap in Visual Studio Code?

Word wrap in Visual Studio Code allows long lines of code to automatically fit within the width of the editor, preventing the need for horizontal scrolling.

How to Enable and Disable Word Wrap in Visual Studio Code?

In this tutorial, you will learn how to easily enable and disable this feature.


Enabling Word Wrap

Option 1: Using the View Menu

  1. Open your file in VS Code.
  2. Go to the top menu and select:
    View → Toggle Word Wrap Alt + Z
  3. Long lines will automatically wrap to fit the editor width.

Option 2: Using the Status Bar

  1. On the bottom bar, look for the button that says No Wrap or Word Wrap Off.
  2. Click it to enable word wrap.
  3. You will see it change to Wrap and long lines will adjust to the editor width.

Option 3: Advanced Settings

  1. Open the command palette: Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac).
  2. Type Preferences: Open Settings (JSON) and press Enter.
  3. Add or modify the following line in your settings:
"editor.wordWrap": "on"

| Tutorials | Visual Studio Code |