Ubuntu – How to wrap text/comments in Visual Studio Code

ide

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.

Best Answer

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