‘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 that the developer must know when 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 this by configuring settings
First, Use settings
- In the left bar, click on the manage icon >
Text Editorand the right side contains the 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 the indentation of wrapping lines
The second way, use the
Word Wrap option in the File Menu.
The following are steps to enable the Word Wrap.
Word Wrapor use short cut
- 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
.vscodefolder under a project
- Create a file settings.json
- update the
setttings.jsonfile with the below configuration
Here column length is provided as 80 character length that wraps into a new line.
- save these settings and Restart VSCode to make changes.