Skip to content

Too many settings in settings file #209

@pomeh

Description

@pomeh

While I really like this package, I think there are too many predefined settings in all your sublime-settings.
I installed the package to have in the first place better syntax highlighting. That's why for example I don't understand why those settings are defined in Markdown (Standard).sublime-settings:

{
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": false,
    "auto_match_enabled": true,
    "draw_centered": true,
    "word_wrap": true,
    "wrap_width": 80,
    "rulers": [],
    "line_numbers": false,
    "highlight_line": false,
    "line_padding_top": 2,
    "line_padding_bottom": 2,
    "caret_style": "wide",
    "caret_extra_top": 3,
    "caret_extra_bottom": 3,
}

I do not want my ruler disappear when editing markdown text, I do not want line numbers disappear when editing markdown text, I do want to use tabs instead of spaces, and I prefer definitely wrap lines at 100 instead of 80. You should not change those settings on the behalf of the user, it's not what he expects from the package, at least it's not what I expect. The settings you are defining have too strong default values, it mess with my general preferences.

There is already one solution for this problem, or I should say there are three solutions:

  • use the file User/Markdown.sublime-settings to override the settings in MarkdownEditing/Markdown.sublime-settings
  • use the file User/Markdown (Standard).sublime-settings to override the settings in MarkdownEditing/Markdown (Standard).sublime-settings
  • use the file User/MultiMarkdown.sublime-settings to override the settings in MarkdownEditing/MultiMarkdown.sublime-settings

So I should copy almost my entire Preferences.sublime-settings file 3 times to retrieve my prefered settings when editing a Markdown file ? That's not what I call a solution, it's only a workaround. A workaround to a problem that should even not exist in the first place.

I may have a working solution to resolve this problem while not changing too many things: use a subkey settings to store the default Sublime Text settings.

Instead of having the following Markdown (Standard).sublime-settings file format:

{
    "color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",

    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": false,
    "auto_match_enabled": true,

    "mde.match_header_hashes": false,

    "mde.list_indent_bullets": ["*", "-", "+"],
}

switch to the following format:

{
    // package specific settings
    // those settings are a totally non-sense everywhere but in this package
    // so they belong to here without problem
    "mde.match_header_hashes": false,
    "mde.list_indent_bullets": ["*", "-", "+"],

    // since you have a specific color_scheme for Markdown
    // it's ok to let this setting here
    "color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",

    // All general Sublime Text preferences related to view settings
    // belong to a "view" subkey. The list of possible options can
    // be found via Preferences -> Settings - Default
    "view": {
        "tab_size": 4,
        "translate_tabs_to_spaces": true,
        "trim_trailing_white_space_on_save": false,
        "auto_match_enabled": true,
    },
}

This is the exact same technique as the package Sublimerge uses for it's settings, and it works very well:

  • you can keep all your current settings default values,
  • you allow the user to override any number of the proposed settings,
  • you allow the user to completely and easily remove your view settings with the following User/Markdown.sublime-settings content:
{
    "view": {
    },
}

Thanks a lot for your answer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions