24

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?

6
  • 4
    Press F1 and type wordwrap in to the box for the toggle option? Commented Jun 9, 2017 at 15:09
  • 2
    Possible duplicate of How to switch word wrap on and off in VSCode? Commented Jun 9, 2017 at 15:10
  • Alternatively, why not just use resource files? Either the images themselves or the base64 string can be in a resource file. Commented Jun 9, 2017 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^^ Commented Jun 9, 2017 at 15:18
  • @AlexK. well finally an answer I can work with. After searching the web for hours finally a "work-around" which works. Commented Jun 9, 2017 at 15:22

3 Answers 3

33

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

Sign up to request clarification or add additional context in comments.

4 Comments

I wish there were a way to not involve the mouse in this.
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
is there a way to rebind horizontal scrolling from alt+shift+scroll to ctrl+scroll?
Possibly, haven't looked into it, but this could help. code.visualstudio.com/docs/getstarted/…
30

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

2 Comments

Sadly, this doesn't work for special text coming from extensions, like warnings and errors.
This is not an answer to the question. The question is how to scroll horizontally. What does word wrap even have to do with it? While that may work for plain text, it's not a workable solution for reading code, which is primarily what VS Code is for.
1

Since November 2022, you can assign custom shortcuts to the actions scrollLeft and scrollRight. By default, they are not assigned to anything.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.