Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code built-in hard wrap

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.

like image 852
ctafur Avatar asked Oct 16 '16 12:10

ctafur


2 Answers

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.

like image 158
Khalid Hussain Avatar answered Oct 26 '22 09:10

Khalid Hussain


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
}
like image 26
banan3'14 Avatar answered Oct 26 '22 09:10

banan3'14