Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

vscode settings - 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...