What is the property name to break long lines in VS Code?

Visual Studio-Code

Visual Studio-Code Problem Overview


When I have long text line I would like to show it next line. enter image description here

What is the property name in VS Code?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

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 - Visual Studio-Code

On Windows, press Alt + Z (macOS: Option ⌥ + Z) to toggle word wrapping, or, select View > Toggle Word Wrap from VSCode Menu.

Solution 3 - Visual Studio-Code

For Windows, Pressing Alt+Z will break the line.

Solution 4 - Visual Studio-Code

For Windows users do the following in -->

  1. Open VScode
  2. Go to Settings(Gear icon on the bottom-left side)
  3. Click Settings in the menu
  4. In the searching bar search for "word wrap"
  5. 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 - Visual Studio-Code

In VS Code:

  1. Install Beautify plugin. (or any Formatter)
  2. Go to the file & select the desired part.
  3. Right-Click on it & select Format Selection Or press Ctrl + k Ctrl + F.

Hope this helps.

Solution 6 - Visual Studio-Code

HTML > Format: Wrap Line Length set the maximum number of characters (for example - 1000)

Solution 7 - Visual Studio-Code

You can press Ctrl + W / Ctrl + L to toggle word wrapping or select Main menu "Edit>Advanced>Word Wrap" .

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStepan SuvorovView Question on Stackoverflow
Solution 1 - Visual Studio-CodeMable JohnView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeJonathan RamosView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeJustAnotherGirlView Answer on Stackoverflow
Solution 4 - Visual Studio-Codeiam_anirbanView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeBobby T.View Answer on Stackoverflow
Solution 6 - Visual Studio-CodeSerg BakayView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeUmesh DhusView Answer on Stackoverflow