How to Enable Word Wrap to Disable Horizontal Scrolling in VS Code

VS Code doesn’t have word wrap enabled by default. So, if you have long lines of code, a horizontal scrolling bar will appear.

If you handle design and write HTML, then long lines will definitely happen. So, it becomes frustrating to scroll horizontally all the time.

Luckily, there’s a simple solution for this, and I’ll share it with you fine people.

Disable Horizontal Scrolling in VS Code by Enabling Word Wrap

I’ll show you how to do it per file or for all files.

Set Word Wrap Globally

If you want to apply word wrap to all your files in Visual Studio Code, here’s what you need to do.

Go to File > Preferences > Settings and type in “word wrap” in the Search settings field.

Then, where it says Editor: Word Wrap, select on from the drop-down menu.

That’s it!

Toggle Word Wrap Per File

If you want to quickly toggle word wrap on and off per file in VS Code, then you can simply press ALT+Z on your keyboard, or go to View > Toggle Word Wrap.

As simple as that! 😀

Learn more: VS Code Fix for “End of line character is invalid” PHPCS Error

That’s a Wrap

I hope you found this tutorial useful!

If you have questions or thoughts, please leave a comment or send me a message using the contact page.

Don’t forget to share the post to help out others!

6 thoughts on “How to Enable Word Wrap to Disable Horizontal Scrolling in VS Code”

Leave a Comment