Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show full long line in visual studio code (word wrap off)

I want to be able to view complete long line (on a single line) in visual studio code. The editor is terminating the line with ... at the end.

I can press the End key to move to the last column of the line but its not visible in the viewport.

Is there any option to be able to view complete long lines like we can in Sublime Text or Notepad++?

VS Code long line

like image 408
imlokesh Avatar asked Jun 14 '18 16:06

imlokesh


People also ask

How do you wrap a long text in VS Code?

If you want to use text word wrap in your Visual Studio Code editor, you have to press button Alt + Z for text word wrap.

How do you show line length in VS Code?

In VSCode, go 'Code -> Preferences -> Settings' and search for "python formatting black args". A few notes about line lengths in Python: PEP8 recommends a line length of 79 characters (72 for docstrings) Black sets line lengths to 88 characters by default.


2 Answers

The answer is in this GitHub issue:

The current recommendation is to turn on word wrapping if the intent is to edit past the 10k limit or change the limit via the "hidden" setting "editor.stopRenderingLineAfter" which is equal to 10000 by default, but which can be changed to -1 to never stop rendering. But then freezes/lagging might occur.

In other words, use CTRL + SHIFT + P to open up the Command Palette, select Preferences: Open Settings (JSON), and add the following line:

"editor.stopRenderingLineAfter" : -1 

If you want to set a hard limit just change the -1 to whatever number of characters you want. Note that you might still get wrapping happening if you haven't disabled it, which you can toggle with ALT + Z or using the other methods mentioned in this Stack Overflow post.

like image 172
Mihai Chelaru Avatar answered Sep 20 '22 04:09

Mihai Chelaru


In other words, use CTRL + SHIFT + P to open up the Command Palette, select Preferences: Open Settings (JSON), and add the following line:

"editor.wordWrap": "on"

like image 22
Fahim Uddin Avatar answered Sep 21 '22 04:09

Fahim Uddin