| 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.
In this tutorial, you will learn how to easily enable and disable this feature.
Enabling Word Wrap
Option 1: Using the View Menu
- Open your file in VS Code.
- Go to the top menu and select:
View → Toggle Word Wrap
Alt + Z - Long lines will automatically wrap to fit the editor width.
Option 2: Using the Status Bar
- On the bottom bar, look for the button that says
No Wrap
orWord Wrap Off
. - Click it to enable word wrap.
- You will see it change to
Wrap
and long lines will adjust to the editor width.
Option 3: Advanced Settings
- Open the command palette:
Ctrl + Shift + P
(Windows/Linux) orCmd + Shift + P
(Mac). - Type
Preferences: Open Settings (JSON)
and press Enter. - Add or modify the following line in your settings:
"editor.wordWrap": "on"
| Tutorials | Visual Studio Code |