Rowe Morehouse
Rowe Morehouse

Reputation: 4585

Tell Sublime Text 3 to always default to "Word Wrap Column: Automatic"?

Can't find the answer anywhere.

I want Sublime Text 3 to default to View > Word Wrap Column > Automatic for new files, and globally for all syntaxes.

I'm not looking for "word_wrap": true … got that covered.

… any ideas? thank you.

Upvotes: 3

Views: 2220

Answers (1)

OdatNurd
OdatNurd

Reputation: 22791

The settings that control word wrap are:

    // 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",

    // Set to a value other than 0 to force wrapping at that column rather than the
    // window width
    "wrap_width": 0,

The first one controls whether word wrap is always on, always off or auto-selects based on the type of file. You've set that one to true, which enabled word wrap everywhere.

The second one specifies what the wrap column is set to. The default value of 0 corresponds to wrapping at the width of the window , which is the Automatic setting that you want, while setting it to some other value wraps at that column specifically.

Note that both of these settings are editor settings, so the settings in your preferences set the defaults, but they can also be overridden in syntax specific settings, project settings and also on a file by file basis (if you use the menu items to change the value).

So, if you don't see the setting properly applying in some types of files, open a file of that type and use Preferences > Settings - Syntax Specific to open the settings specific for that type of file and adjust or manually add the setting there.

Similarly, if it works in some projects and not others, use Project > Edit Project from the menu and adjust the settings key in the project (projects don't have one by default so you only need to do this if you or someone else added one and forced the setting).

For the view specific settings adjusted using the menu, you can either adjust the setting again with the menu or close and re-open the file, which will remove your adjustments and put things back to the way the settings normally apply.

Upvotes: 5

Related Questions