247

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
  • 25,369
  • 29
  • 96
  • 135
Yakuza
  • 3,237
  • 2
  • 21
  • 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

11 Answers11

319

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
  • 1,400
  • 1
  • 9
  • 18
Katherine
  • 3,318
  • 1
  • 13
  • 17
  • 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
  • 3
    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
  • For version `1.81.1`, the path is `File -> Preferences -> Settings`. Search for `word wrap` on the search bar and select `On` from the dropdown. – nice_dev Aug 29 '23 at 09:33
65

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
  • 819
  • 6
  • 6
28

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
  • 33,312
  • 6
  • 76
  • 74
  • 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
28

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
  • 736
  • 9
  • 9
  • 2
    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
6

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
  • 160
  • 3
  • 7
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,458
  • 10
  • 44
  • 49
2

caw5v's answer mentions that word wrapping would not work if accessibility is on.

But that will change with VSCode 1.73 (Oct. 2022):

We disable word wrap when accessibility is turned on.
I would remove this limitation due to three reasons

  1. User feedback
  2. Now the status bar is accessible and Ctrl + g announces line number so it is much easier to figure out what line you are on
  3. WordWrap is off by default if the user turns it on he or she should be aware of it

This is now the new policy available today in VSCode Insiders:
If you activate Word Wrap, it will be active even if Accessibility mode is on.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Go to File > Preferences > Settings OR use shortcut key ctrl + ,

enter image description here

Now type keyword word wrap and do ON/OFF as per your preference.

enter image description here

Ketan Chaudhari
  • 329
  • 3
  • 7
0

For those still having issues, make sure to check if 'Accessibility Support' is on. While "on" word wrapping can be disabled if a screen reader is detected.

settings > user&workspace > accessibility support

This worked for me. I run two additional monitors, however, I use an m1 macbookpro so support for two monitors is not available. To solve this I use a displaylink connection. Vscode appears to identify my displaylink connection as an accessibility screen reader.

caw5v
  • 1