Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn on text wrapping by default in VS Code

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?

like image 274
Yakuza Avatar asked Jul 25 '16 07:07

Yakuza


People also ask

How do I enable vs Wrap in code?

You can toggle word wrap for the VS Code session by pressing a key combination. On Windows or Linux, simply press Alt+Z. On MacOS, you can also press Option ⌥ + Z. Alternatively, one can enable/disable word wrapping by selecting View > Word Wrap from the Menu.

Why word wrap is not working in VS Code?

Go to File->Preferences->Settings. Set the workspace tab (but it's the same with User tab) Set the editor: Word Wrap settings to wordWrapColumn. Set the Editor: Word Wrap Column to 80.

How do I set default code in VS?

Go to File -> preferences -> settings. On the right panel you will see all customized user settings so you can remove the ones you want to reset. On doing so the default settings mentioned in left pane will become active instantly.

How do you wrap long lines in VS Code?

You can toggle word wrap for the VS Code session with Alt + Z (macOS: Option (or Alt) ⌥ + Z ) or select View > Word Wrap from Menu.


2 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.

like image 110
Katherine Avatar answered Sep 27 '22 20:09

Katherine


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."

like image 35
Paul Morris Avatar answered Sep 27 '22 20:09

Paul Morris