248

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?

1

11 Answers 11

322

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.

6
  • 3
    Yes, this setting was changed in VSCode 1.10: code.visualstudio.com/updates/… Apr 5, 2017 at 2:17
  • 1
    Even if you make it on horizontal bar appears and scrolls after resize
    – atilkan
    May 24, 2019 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, 2019 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 5, 2020 at 8:11
  • 1
    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 at 9: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."

4
  • But, by default? How do you get this method to "stick"? Oct 2, 2019 at 16:50
  • It defaults for me? Try restarting? Sorry I'm not sure. I'm using 1.40.1 in Mojave and it's still working. Note: using View > Wordwrap won't set it as default Nov 18, 2019 at 19:29
  • choose Editor:Word Wrap ,Controls how lines should wrap. choose on Jun 24, 2021 at 10:30
  • File > Preferences > Settings > Text Editor
    – Dennis H
    Jul 13, 2022 at 3:31
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.

3
  • 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, 2016 at 9: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, 2016 at 9:04
  • My apologies, I focused on "-1" value and missed "0". Works perfectly! Thanks!
    – Yakuza
    Jul 25, 2016 at 9: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.

1
  • 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, 2021 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.

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.

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.

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.