197

Usually when I use VS Code, very first thing I do on new document is command: "Toggle Word Wrap" or Alt+Z. I tried looking into User Settings, but I didn't find any relevant entries. Is there some way to have text wrapping 'on' for every document by default?

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104
Yakuza
  • 2,597
  • 2
  • 20
  • 18
  • More info here https://stackoverflow.com/questions/43122175/automatically-hard-wrap-lines-at-column-in-vscode/45883430 – frederj Nov 26 '19 at 16:17

8 Answers8

253

The setting is now "editor.wordWrap": "on", which should be set to "on" (the default value is "off").

Switching to "on" activates word wrap on all documents in Visual Studio Code.

See the release notes about Word Wrap changes for more info.

David Wolf
  • 682
  • 3
  • 11
Katherine
  • 2,640
  • 1
  • 12
  • 13
  • 3
    Yes, this setting was changed in VSCode 1.10: https://code.visualstudio.com/updates/v1_10#_word-wrap-settings-redesign – Matt Bierner Apr 05 '17 at 02:17
  • 1
    Even if you make it on horizontal bar appears and scrolls after resize – atilkan May 24 '19 at 12:40
  • 1
    I think this feature is still broken. When I initially load a page, word wrap works as intended. Once I make any changes whatsoever, word wrap breaks. Now to be fair, I haven't tested this with all my extensions turned off. I don't have time to do that. I just want the stupid thing to work. It's so frikin annoying. – Mike S. May 30 '19 at 18:16
  • 1
    one can access the json file with the settings by typing `CTRL + SHIFT + P`, then typing 'open default settings (JSON)' – BCArg Aug 05 '20 at 08:11
  • This also works if your VS Code begins to scroll to the right constantly without input. – Josmoor98 Oct 14 '20 at 08:47
50

Version 1.32.3

If you don't want to edit any files you can just turn it on under user settings:

Code > Preferences > Settings > Text Editor

Type "wordwrap" in the search or scroll to bottom of the list just before the cursor section. You'll see it as "Word Wrap / Controls how lines should wrap."

Paul Morris
  • 669
  • 5
  • 6
26

Have a look at the setting editor.wrappingColumn (see the docs for more information)

Update 2017-04-06:

Recently the setting changed (see here) to editor.wordWrap with several options:

We therefore decided to deprecate editor.wrappingColumn (with its -1, 0, >0 cases) in favor of editor.wordWrap.

Here are the new word wrap options:

editor.wordWrap: "off" - Lines will never wrap.
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.

DAXaholic
  • 31,036
  • 5
  • 72
  • 73
  • Hey! Thank you for this answer, it works almost as I expect, but there is one issue with this solution: it breaks lines at fixed point, regardless window size, which is not consistent with Word Wrap mode. What I'm really looking for is to actually trigger this word wrapping. If it will turn out impossible I'll accept this answer. – Yakuza Jul 25 '16 at 09:03
  • 1
    Did you try setting it to 0, as the docs say "Setting this to 0 turns on viewport width wrapping (word wrapping)" – DAXaholic Jul 25 '16 at 09:04
  • My apologies, I focused on "-1" value and missed "0". Works perfectly! Thanks! – Yakuza Jul 25 '16 at 09:35
18

In 2020, here are simple steps to do it.

  • Click on 'File' on the top menu.
  • Click on 'Preferences' --> 'Settings'.
  • Scroll a little bit until you find 'Editor: Word Wrap'.
  • Click on the dropdown menu and choose 'on'.
  • Done. Settings will be saved by default.

Hope this helps.

Amjad Abujamous
  • 544
  • 7
  • 7
  • 1
    Thank you, this is the best answer. I didn't know how to edit with commands, hence was looking exactly for this. – P. Vowk Mar 16 '21 at 21:37
5

So easy. This solution worked for me.

Click on 'File' on the top menu. Click on 'Preferences' --> 'Settings'. Search Word Wrap in the search box then you will see Editor: Word Wrap. Click on the dropdown menu and choose 'on'. It will definitely work. Thank You.

MOHD FARAZ
  • 121
  • 3
  • 4
4

Firstly go to the setting-> the search on search box word wrap-> then on the word wrap option.

3

Open User Settings Json and add ( As shown in the image below)

"editor.wordWrap": "on",

enter image description here

3
  • Press ctrl + , from the keyboard.

This will take you to the settings tab.

  • Type word wrap in the search tab.
  • Click on Editor: Word Wrap drop down.
  • Select on.

You are done. See the image and follow the red boxes.

ouflak
  • 2,408
  • 10
  • 40
  • 47