What is the property name to break long lines in V

2020-05-25 04:11发布

问题:

When I have long text line I would like to show it next line.

What is the property name in VS Code?

回答1:

The menu under File > Preferences (Code > Preferences on Mac) provides entries to configure user and workspace settings. You are provided with a list of Default Settings. Copy any setting that you want to change to the related settings.json file.

Set editor.wordWrap: bounded in your 'User Settings' or 'Workspace Settings' under preference.

// Lines will wrap at the minimum of viewport and "Editor: Word Wrap Column".
"editor.wordWrap": bounded

OR

// Lines will wrap at the viewport Width
"editor.wordWrap": true

As "Jonathan Ramos suggest", you can use shortcuts (Key Bindings for Visual Studio Code) alt+z or select View > Toggle Word Wrap from Menu.

For more about User and Workspace Settings



回答2:

On Windows, press alt+z to toggle word wrapping, or, Select "View > Toggle Word Wrap" from VSCode Menu.



回答3:

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



回答4:

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



回答5:

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.