55

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

imlokesh
  • 2,506
  • 2
  • 22
  • 26

4 Answers4

63

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.

Mihai Chelaru
  • 7,614
  • 14
  • 45
  • 51
  • 1
    I'm not getting the toknization errors if I turn off this setting: "editor.largeFileOptimizations": false – Peheje Jun 26 '19 at 11:28
  • 1
    Pressing CTRL + , does not allow adding a new line because it does not lead to a text file, instead it leads to GUI settings. – Preza8 Jan 02 '20 at 16:49
  • 1
    @Preza8 That's a good point. Since I posted this answer, the User settings UI has changed and it looks like you can't even search for this setting in there. As such, it would be better to use the command palette and open up **Preferences: Open Settings (JSON)** and make the change there. – Mihai Chelaru Jan 02 '20 at 17:26
  • That's no longer supported, `largeFileOptimizations` did the trick for me – nikksan Aug 21 '20 at 08:58
  • @nikksan Do you have a link to an official source saying the feature's no longer supported? If not, can you explain a bit more? – Mihai Chelaru Aug 24 '20 at 13:38
  • 1
    @MihaiChelaru I didn't read the full answer and assumed it was not supported when the IDE didn't recognize it. – nikksan Aug 26 '20 at 14:28
  • 2
    It work, though it's gray in user's settings.json. – ahdung Jun 05 '21 at 01:11
13

Try using: alt + z

unwrapped code

unwrapped code

wrapped code

wrapped code

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
cedenoaugusto
  • 131
  • 1
  • 3
0

On version 1.41.1 you can set Editor: Word Wrap to on inside Preferences/Settings. To go to Settings, use Cmd + , in Mac and Ctrl + , in Windows.

-1

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"