Beast_Code Beast_Code - 1 year ago 37
HTML Question

How to stop lines of code from automatically shifting to the next like whenever I resize the window of the editor?

I am using Sublime Text 2. When I am on an HTML file. If I resize the window. The code at the very end shifts down to the next line. How do I stop this from happening? I want the code to continue onward, so I will have to scroll side to side to see the rest of the code and not have the shift to the next line.

I have taken screenshots to better illustrate what I am referring to.

Full window of code

After window has been resized. Notice the number lines? How do I stop that? I'd rather scroll right to see the rest of the code instead of having the code jump to the next line.

Resized window

I noticed this only happens in an HTML file.


Look in the DEFAULT Preferences.sublime-settings file for the setting below:

// Disables horizontal scrolling if enabled.
// May be set to true, false, or "auto", where it will be disabled for
// source code, and otherwise enabled.
"word_wrap": "auto",

If you want the default for word wrap to be OFF for ALL syntax types:

Copy `"word_wrap": "auto",` into your USER Preferences.sublime-settings file 

If you want the default for word wrap to be OFF for 'code' and OFF for HTML but ON for other syntax types:

Copy `"word_wrap": "auto",` into the HTML.sublime-settings file 

Set it to "word_wrap": "false",.

Now your default for HTML will be word wrap is OFF.

You can change this anytime by toggling the Word Wrap item in the View menu OR by launching the Control Panel and typing enough of word wrap until the Word Wrap: Toggle item is selected and hitting Return.