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

by Radu

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! 😃

That’s a Wrap

I hope you found this tutorial useful.

If some info is outdated or incorrect, or you have anything to add, say or ask, please contact me via Twitter or email.

About Radu

I've been working online, from home, for over 9 years. I learned a lot of different stuff related to websites. My main expertise is WordPress, but for some time, I started focusing more on web development.