23

What is the keyboard shortcut/menu path to wrap text, comments, etc. in Microsoft's Visual Studio Code?

I couldn't locate it in User Preferences. Here's the screenshot which has a lot of comments that I'd like to wrap:

Enter image description here

I know Sublime Text 2 has that option under menu EditWrap, but I couldn't find anything similar in Visual Studio Code.

3 Answers3

34

File > Preferences > Settings

New Setting UI (Searchable )

Settings UI now Search Powered

Just Search Wrap / Word Wrap

  • editor.wordWrap: "off" - Lines will never wrap. editor.wordWrap: "on" - Lines will wrap at viewport width
  • editor.wordWrap: "on" - Lines will wrap at viewport width.
  • editor.wordWrap: "wordWrapColumn" - Lines will wrap at the value of editor.wordWrapColumn.
  • editor.wordWrap: "bounded" - Lines will wrap at the minimum of viewport width and the value of editor.wordWrapColumn.

References: https://code.visualstudio.com/updates/v1_10#_word-wrap-settings-redesign and info from @jermila-dhas

Deprecated (For History Purpose/How JSON setting should look like)

File > Preferences > User Settings

For Beginner

Paste the following in settings.json

// Place your settings in this file to overwrite the default settings
{       "editor.wrappingColumn": 0 }

That it, it is that simpler, but probably we will having someone open source user interface for json settings.

For Intermediate User

If you already have settings.json, just add

"editor.wrappingColumn": 0

As the settings is in JSON, last settings are without the comma , and setting is ending with } as you see in Default settings and the settings.json overide all the Default settings

Edward Chan JW
  • 756
  • 8
  • 10
  • 4
    Woww.... very nicely hidden. Well done Microsoft. – Aliostad Jul 22 '15 at 19:56
  • 1
    Totally agree. But the performance and features make Visual Studio code ease to use for certain languages that supported. – Edward Chan JW Jul 23 '15 at 07:28
  • Take a look at all settings at https://gist.github.com/matijagrcic/8e86d8be1d600514826c#file-visual_studio_code_default_settings-js or press Press Ctrl+Shift+O in the list of default settings to see an outline of all available settings. – Matija Grcic Jul 25 '15 at 12:10
  • It was driving me nuts to have to scroll. Will need to checkout other settings. Thanks. – thehme Jan 16 '17 at 15:58
  • If you'd like to indent wrapped lines more than the initial line, use "editor.wrappingIndent": "indent" (or deepIndent). – Qwertie Jan 05 '19 at 00:13
5

If you are using visual studio code v1.10, the setting "editor.wrappingCloumn" has been deprecated.

Use "editor.wordWrap": "on" instead.

More information can be found here

(Hoping this might help somebody)

3

you can do it by this shortcut : alt + Z

dlin
  • 3,830
amdan
  • 131