Visual Studio Code built-in hard wrap
Asked Answered
W

2

15

I'm doing some documentation in Markdown using Visual Studio Code. The problem is that I'm used to hard wrapping.

The only way I've found for setting hard wrapping in Visual Studio Code is by the EditorConfig extension. EditorConfig is not a Microsoft extension and sometimes you can see weird things happening such as wrapping some inline code (between backticks: ``) for instance.

Is there some built-in way of setting hard wrapping in Visual Studio Code? If not, how do people set soft wrapping in Visual Studio Code in order to make Markdown look great (for instance, keep the indentation after a wrap in a bulleted list long paragraph)? Is it scheduled for a future release built-in hard-wrapping in Visual Studio Code?

Thanks

Update: In hard-wrapped text each new line is actually a line, has a different number. Soft wrapping is wrapping only for display: you change the viewport and lines changes, but each paragraph is just a line, a number ---as in VS Code.

Update2: You can hard wrap with the VSCodeVim extension now the same way you wrap in Vim: g, q, } or any other combination with g, q.

Wellknown answered 16/10, 2016 at 12:0 Comment(7)
It would help if you were to provide a precise definition of "hard wrapping".Faiyum
When the line is wrapped, a carriage-return/linefeed character(s) is inserted into the text.Aitken
This doesn't seem to be part of EditorConfig anymore, found another solution?Gass
My mistake, the extension I used for hard wrapping was Rewrap, but I think you can't have the same control as in Vim or Emacs. Maybe you can make it by settings.json.Wellknown
This is really a critical question imho! Doing this in vim is quick and painless. I spent the night yesterday finding out if there is a possibility ! No there isn't. I need such functionality for latex (with git). It seems its just not possible with VSCODE ! That doesn't seem right.Espino
Possible duplicate of Automatically hard wrap lines at column in VSCodeOphicleide
I have found that you can do it with a formatter or a linter also.Wellknown
D
7

I currently use the ReWrap extension for creating hard text wraps.

I'm happy with the defaults. However, the plugin does offer settings you can configure to your liking.

Damales answered 10/4, 2019 at 0:12 Comment(0)
S
-1

To quickly toggle word wrapping, you can use Alt+Z.

You can find the following setting, after going to Preferences: User Preferences:

"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 100

It will put EOL in the 100th column of every line.

If you want to use it only for markdown, you can use

"[markdown]": {
    "editor.wordWrap": "wordWrapColumn",
    "editor.wordWrapColumn": 100
}
Schauer answered 16/5, 2018 at 13:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.