‘Word Wrap’ is a feature that allows you to limit text content to a certain width on the row in the editor window.

If you have a long line of text on a single line, for example, the user will have to scroll horizontally to see the content. With word wrap, the text is spread into multiple lines, and the content is limited to fit within the code window.

Any editor provides this as a basic feature. Out of the box, VSCode supports word wrap.

This is an important tip for the developer must know working with Atom Editor.

How to limit column limit with word wrap in Visual Studio Code editor automatically

There are multiple ways, we can do by configuring settings

First, Using settings

  • In the left bar, click on the manage icon > Settings
  • Select Text Editor and right side has contains below options Editor: Word Wrap - It enables how lines should wrap in a row Editor: Word Wrap Column: 60 - Limit the column character length when word-wrap is enabled. Editor: Wrapping Indent: It controls indentation of wrapping lines

The second way, use the Word Wrap option in File Menu.

Following are steps to enable the Word Wrap.

  • View >Word Wrap or use short cut Alt + Z
  • This wraps the lines with a default limit of 80 characters.
  • These changes are saved and applied to the editor permanently.

Third ways, project-specific settings

  • Create a .vscode folder under a project
  • Create a file settings.json
  • update setttings.json file with the below configuration
  {

     "editor.wordWrap": "wordWrapColumn",
     "editor.wrappingIndent": "same",
    "editor.wordWrapColumn": 80


  }

Here column length is provided as 80 character length that wraps into a new line.

  • save these settings and Restart VSCode to make changes.