Skip to main content

How to Enable Word Wrap in VS Code

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

Word wrap in Visual Studio Code — you will also see it called line wrap or text wrap — automatically moves long lines of code or text onto the next line instead of letting them run off the right edge. It makes files far easier to read and edit in VS Code, especially on a smaller screen.

Enable Word Wrap via Menu

  1. Open your file in VS Code.
  2. Go to the top menu and select View > Word Wrap.
    • Alternatively, use the command palette (Cmd+Shift+P on Mac or Ctrl+Shift+P on Windows/Linux), then type and select Toggle Word Wrap.

Enable Word Wrap via Settings

  1. Open Settings (Cmd+, on Mac or Ctrl+, on Windows/Linux).

Go to Settings

  1. Search for word wrap.
  2. Set Editor: Word Wrap to on.

Set Word Wrap

Alt+Z: The Word Wrap Keyboard Shortcut

Press Alt+Z (Windows and Linux) or Option+Z (Mac) to toggle word wrap on or off in the editor. This is the quickest way to wrap text in VSCode and the shortcut most people are looking for.

The official VS Code documentation describes Alt+Z as toggling word wrap for the VS Code session — it is not written to your settings, so it does not survive a restart. To make line wrap permanent, use the setting in the next section instead.

Make Word Wrap the Default in VSCode

The menu and the shortcut both wrap only the current file. To turn line wrap on for every file you open:

  1. Open Settings (JSON view).
  2. Add the following line:
"editor.wordWrap": "on"

Per the official documentation, editor.wordWrap defaults to off; setting it to on wraps text at the width of the editor's viewport. Unlike Alt+Z, this is saved in your settings and applies every time you open VS Code.


Now you can enjoy better readability and a cleaner editing experience in VS Code!

Additional Resources

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.