File > Preferences (Code > Preferences on Mac)
下的菜单提供用于配置用户和工作区设置的条目。您将获得默认设置列表。将要更改的任何设置复制到相关的settings.json文件。
在首选项下的“用户设置”或“工作区设置”中设置editor.wordWrap:bounded
。
// 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
正如“Jonathan Ramos建议的”,您可以使用快捷方式(Key Bindings for Visual Studio Code)alt+z
或从菜单中选择View > Toggle Word Wrap
。
有关User and Workspace Settings的更多信息
您可以按alt + z切换自动换行或从VSCode菜单中选择“查看>切换自动换行”。
对于Windows,按Alt + Z将中断该行。
您可以按Ctrl + W / Ctrl + L切换自动换行或选择主菜单“编辑>高级>自动换行”。