17

I am consulting you since I am dealing with something that bothers me about VSCode.

We are currently creating an application which is supposed to run locally so we do have a lot of base64 lines in our code. As you can imagine, these strings are quite large:

enter image description here

This is problematic for me (and my co-workers) since we are interested in this light-weight "Visual Studio"-like editor but can not avoid this line breaking from happening, which makes it very complicated to navigate certain scripts.

Is there an option to horizontally scroll the editor so the strings wont be hacked into window size creating this mess?

So far, I did not find anything that would help with my problem. Does anyone here have a clue what I'm after and where I could find it?

j08691
  • 204,283
  • 31
  • 260
  • 272
N. Kuck
  • 173
  • 1
  • 1
  • 8
  • 4
    Press F1 and type wordwrap in to the box for the toggle option? – Alex K. Jun 09 '17 at 15:09
  • 2
    Possible duplicate of [How to switch word wrap on and off in VSCode?](https://stackoverflow.com/questions/31025502/how-to-switch-word-wrap-on-and-off-in-vscode) – j08691 Jun 09 '17 at 15:10
  • Alternatively, why not just use resource files? Either the images themselves or the base64 string can be in a resource file. – 0xFF Jun 09 '17 at 15:14
  • @fhl oh, I didn't specify that we need to make our application into a single file html, did I? When you have another solution I am willing to learn^^ – N. Kuck Jun 09 '17 at 15:18
  • @AlexK. well finally an answer I can work with. After searching the web for hours finally a "work-around" which works. – N. Kuck Jun 09 '17 at 15:22
  • Given the description of the question, I don't think you're interested in horizontal scrolling but rather in wordwrapping. Changing the title might be appropriate. – Philippe Fanaro May 21 '20 at 13:09

2 Answers2

27

Alt + Shift then use the scroll wheel. This will horizontal scroll for you :)

Not the most efficent but you can slowly pane left and right
Ctrl + ⬅️ Will jump left one word per press
Ctrl + ➡️ Will jump right one word per press
With these commands if you also hold down Shift you will select the whole word.

This is not really scrolling and it's hard to pay attention to what's going on
Home will move the cursor to the start of the line
End will move the cursor to the very end of the line

Gauthier
  • 1,251
  • 10
  • 25
  • 2
    I wish there were a way to *not* involve the mouse in this. – Philippe Fanaro May 21 '20 at 13:06
  • Not the most efficent, but Ctrl + (left or right arrow), it will jump the cursor one word at a time. Also theres the home and end keys, jump to the end of line or start of line – Gauthier May 22 '20 at 15:09
  • 1
    is there a way to rebind horizontal scrolling from alt+shift+scroll to ctrl+scroll? – Matt May 25 '21 at 19:02
  • Possibly, haven't looked into it, but this could help. https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization – Gauthier Jun 03 '21 at 22:03
22

Wordwrap is there to rescue from horizontal scrolling. Press Alt + z to toggle wordwrap on/off.

Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
krkart
  • 435
  • 4
  • 11