'What is the property name to break long lines in VS Code?
Solution 1:[1]
The menu under File > Preferences or press Ctrl+, (on Mac Code > Preferences > Settings or press Command (or Cmd) ?+,) provides entries to configure user and workspace settings. You are provided with a list of default Settings.
Set editor.wordWrap: on in your User Settings or Workspace Settings under preference.
Select the below options to change to the desired settings.
Off- Lines will never wrap.on- Lines will wrap at the viewport width.wordWrapColumn- Lines will wrap at "Editor: Word Wrap Column".bounded- Lines will wrap at the minimum of viewport and "Editor: Word Wrap Column".
You can toggle word wrap for the VS Code session with Alt+Z (macOS: Option (or Alt) ?+Z) or select View > Word Wrap from Menu.
For more about User and Workspace Settings or Key Bindings for Visual Studio Code
Solution 2:[2]
On Windows, press Alt + Z (macOS: Option ? + Z) to toggle word wrapping, or, select View > Toggle Word Wrap from VSCode Menu.
Solution 3:[3]
For Windows, Pressing Alt+Z will break the line.
Solution 4:[4]
For Windows users do the following in -->
- Open VScode
- Go to Settings(Gear icon on the bottom-left side)
- Click Settings in the menu
- In the searching bar search for "word wrap"
- Click the drop-down menu and change it to "on"
This setting will wrap your words according to your editor: viewport.
In case this auto wrapping isn't working you can press --> Alt + z to wrap content
Solution 5:[5]
In VS Code:
- Install Beautify plugin. (or any Formatter)
- Go to the file & select the desired part.
- Right-Click on it & select
Format SelectionOr press Ctrl + k Ctrl + F.
Hope this helps.
Solution 6:[6]
HTML > Format: Wrap Line Length set the maximum number of characters (for example - 1000)
Solution 7:[7]
You can press Ctrl + W / Ctrl + L to toggle word wrapping or select Main menu "Edit>Advanced>Word Wrap" .
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Ronan Boiteau |
| Solution 3 | JustAnotherGirl |
| Solution 4 | iam_anirban |
| Solution 5 | Bobby T. |
| Solution 6 | Serg Bakay |
| Solution 7 | Machavity |

