How to Enable Word Wrap in VS Code
· One min read
Word wrap is a handy feature in Visual Studio Code that automatically moves long lines of code or text onto the next line, making your files easier to read and edit—especially on smaller screens.
Enable Word Wrap via Menu
- Open your file in VS Code.
- Go to the top menu and select View > Word Wrap.
- Alternatively, use the command palette (
Cmd+Shift+P
on Mac orCtrl+Shift+P
on Windows/Linux), then type and selectToggle Word Wrap
.
- Alternatively, use the command palette (
Enable Word Wrap via Settings
- Open Settings (
Cmd+,
on Mac orCtrl+,
on Windows/Linux).
- Search for
word wrap
. - Set Editor: Word Wrap to
on
.
Keyboard Shortcut
- Press
Option+Z
(Mac) orAlt+Z
(Windows/Linux) to quickly toggle word wrap on or off in the current editor.
Make Word Wrap Default
To always enable word wrap for all files:
- Open Settings (JSON view).
- Add the following line:
"editor.wordWrap": "on"
Now you can enjoy better readability and a cleaner editing experience in VS Code!