How to set word-wrap in VSCode?

Line breaking, also known as word wrapping, is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area.

How to wrap lines automatically in VSCode?

Open Command Palette , type “OFSJ” which is “Preferences: Open Folder Settings (JSON)”. Of course you can choose User Setting or Workspace Setting, but you need to pay attention to the precedence

Type the following settings in the opened json file.

// for all types of files but markdown
"editor.rulers": [80],
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 80,

From now on, most types of files can wrap at 80 characters. For example, this is a HTML file:

How to set word-wrap in VSCode?

The exception is Markdown files which ships with default language specific settings.

How to set word-wrap in VSCode?

So we need to set wordwrap again for Markdown file.

Add the following line into the JSON setting file:

// for markdown only
"[markdown]": {
  "editor.wordWrap": "bounded",
}

Now all the files are word-wrapped at 80 characters width.

How to set word-wrap in VSCode?

本作品采用《CC 协议》,转载必须注明作者和本文链接
日拱一卒
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
93
粉丝
85
喜欢
153
收藏
121
排名:71
访问:11.4 万
私信
所有博文
社区赞助商