At times the code may take up too much horizontal real estate that you may have to perform a vertical scroll to read it. It could really become quite irritating to read code in this way, hence almost all text editors and IDEs have the "Word Wrap" option.
There are multiple ways in which you can toggle the word-wrap feature in VS Code, let's see them one by one,
Option 1: Using the keyboard Shortcuts
This is the quickest way to enable or disable word-wrap.
Windows: Alt + Z
macOS: Option ⌥ + Z
Linux: Alt + Z
Option 2: Using the Palette
Press Ctrl + Shift + P on Windows, or, Command + Shift + P on macOS to open the VS Code Palette.
Now type Toggle Word Wrap to activate it.
This option is really handy if you forget the keyboard shortcut and want to recall it.
Option 3: Using the Menu Options
There is always the Menu that you can visit to perform Word Wrap, but is the slowest as required the use of the mouse or the trackpad.
Go to Menu: View -> Word Wrap
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- Notepad++ Keyboard Shortcuts Cheatsheet
- Shortcut: Move Cursor at the start or end of Line or file in Visual Studio Code (VS Code)
- How to go to next line in Excel on Mac (Keyboard Shortcut)
- Open VS Code Command Palette using Keyboard Shortcut
- Shortcuts: How to Toggle Word Wrap in Visual Studio Code (VS Code)
- What are E, K, N, S, T, U, V in Java Generics - Java
- How to uninstall Microsoft Edge from Mac (macOS) - MacOS
- INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.] Android Eclipse Error - Eclipse
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015 - HowTos
- Fix Xcode: Git Repository Creation Failed - Git
- How to go to the End of File in Nano Editor - Linux
- How to make TextEdit the default text Editor on Mac - MacOS
- ls command to list only directories - Linux