user855443
user855443

Reputation: 2940

VScode: word wrap for markdown not working

I try to have an automatic word wrap when I write markdown text: I expect that lines are automatically broken when I type a line longer than the wrap line length set, by a hard break (i.e. a newline character).

I have set

Nevertheless, lines extend to the end of the editor (much more than 50) and nothing happens. I have tried the toggle word wrap with no effect (it would be great if the state of the toggle would be shown, like for auto save).

What is wrong?

Upvotes: 28

Views: 12033

Answers (1)

skaravos
skaravos

Reputation: 487

VSCode automatically sets some Markdown-specific settings behind the scenes that override general user settings, which is why the "editor.wordWrap" setting is seemingly ignored.

To get around this, you can add the setting as language-specific for markdown files.

i.e. try adding the following to your settings.json file and it should work!

"[markdown]": {
    "editor.wordWrap": "bounded",
    "editor.wordWrapColumn": 80
}

NOTE: There is an open feature-request to make it more obvious when language settings override user defaults. At least they are aware of the issue!

Upvotes: 45

Related Questions