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?
11 Answers
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.
-
3Yes, this setting was changed in VSCode 1.10: code.visualstudio.com/updates/… Apr 5, 2017 at 2:17
-
1Even if you make it on horizontal bar appears and scrolls after resize– atilkanMay 24, 2019 at 12:40
-
1I 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
-
3one can access the json file with the settings by typing
CTRL + SHIFT + P
, then typing 'open default settings (JSON)'– BCArgAug 5, 2020 at 8:11 -
1For version
1.81.1
, the path isFile -> Preferences -> Settings
. Search forword wrap
on the search bar and selectOn
from the dropdown.– nice_devAug 29 at 9:33
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."
-
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
-
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 ofeditor.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 ofeditor.wordWrapColumn
.
editor.wordWrap: "bounded"
- Lines will wrap at the minimum of viewport width and the value ofeditor.wordWrapColumn
.
-
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.– YakuzaJul 25, 2016 at 9:03
-
1Did you try setting it to 0, as the docs say "Setting this to 0 turns on viewport width wrapping (word wrapping)" Jul 25, 2016 at 9:04
-
My apologies, I focused on "-1" value and missed "0". Works perfectly! Thanks!– YakuzaJul 25, 2016 at 9:35
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.
-
2Thank you, this is the best answer. I didn't know how to edit with commands, hence was looking exactly for this.– P. VowkMar 16, 2021 at 21:37
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.
Firstly go to the setting-> the search on search box word wrap-> then on the word wrap option.
- 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.
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
- User feedback
- 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
- 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.
Go to File > Preferences > Settings
OR use shortcut key ctrl + ,
Now type keyword word wrap and do ON/OFF as per your preference.
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.