Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many settings in settings file #209

Closed
pomeh opened this issue Sep 21, 2014 · 10 comments · Fixed by #607
Closed

Too many settings in settings file #209

pomeh opened this issue Sep 21, 2014 · 10 comments · Fixed by #607

Comments

@pomeh
Copy link

pomeh commented Sep 21, 2014

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.

@natecavanaugh
Copy link

+1
This is an awesome package, but I wish it was easier to return to my own preferences (for instance, I really prefer my caret settings, even if just for consistency).

@felixhao28
Copy link
Contributor

These settings exist way back from the initial commit of this project. Maybe it is time to remove those settings. But before that, I need more feedback on which setting should be kept or removed (and the rationale behind that).

@xguse
Copy link

xguse commented Oct 15, 2014

This just make me unistall this plugin. You completely disrespect my standard settings to the point that I have to a ton of my time to try to "fix" things.

This should not completely break a person's editor environment. You change WAY too much stuff by default.

I will be watching this repo to see if anything changes bc yours IS really the best markdown plug in. Except that it is simply unusable as is for me without MAJOR intervention on my part.

EDIT:
for instance:

  • don't assume that you know the user wants to ONLY have access to your color schemes by default (there are many other - better - markdown supporting color schemes out there dont remove the one i already have set up and replace it with your own)
  • dont assume they should be using focusy-type editor settings like center aligning etc

@pomeh
Copy link
Author

pomeh commented Oct 16, 2014

But before that, I need more feedback on which setting should be kept or removed (and the rationale behind that).

@felixhao28 I would say that all default Sublime Text settings should not be present in MarkdownEditing's own settings. For example, if in MarkdownEditing's settings there is the settings "draw_centered": true, defined, then this might override default User's settings, which IMO is wrong. I'm waiting for others to express on this subject too, and have any news from @maliayas.

@xguse
Copy link

xguse commented Oct 16, 2014

After cooling down, I re-installed the plugin, then commented all three markdown-flavor default-settings files for the plug in, then uncommented the mde options that I wanted to use:

{
    // "extensions":
    // [
    //  "md",
    //  "mdown",
    //  "txt"
    // ],

    // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme",
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Yellow.tmTheme",

    // // This is a quick and dirty focus theme. In order to make it work, you've to
    // // set `"highlight_line": true,` in this settings file. It is likely that there will
    // // be more mature focus improvements in the future (maybe similar to iA Writer).
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Focus.tmTheme",

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

    // // Layout
    // "draw_centered": true,
    // "word_wrap": true,
    // "wrap_width": 80,
    // "rulers": [],

    // // Line
    // "line_numbers": false,
    // "highlight_line": false,
    // "line_padding_top": 2,
    // "line_padding_bottom": 2,

    // // Caret
    // "caret_style": "wide",   // "wide" is deprecated starting with ST Build 3057.
    //                          // In the future, this line will be replaced with:
    //                          //     "caret_style": "solid",
    //                          //     "caret_extra_width": 1,
    // // These will work only in ST Build 3057 and later.
    // "caret_extra_top": 3,
    // "caret_extra_bottom": 3,

    // // add trailing #'s to headlines
    // "mde.match_header_hashes": false,

    // Automatically switches list bullet when indenting blank list item with <Tab>.
    "mde.list_indent_auto_switch_bullet": true,

    // List bullets to be used for automatically switching. In their order.
    "mde.list_indent_bullets": ["*", "-", "+"]

    // // Allways keep current line vertically centered.
    // "mde.keep_centered": false,

    // // Distraction free mode improvements. In order these to work, you have to install
    // // FullScreenStatus plugin: https://github.com/maliayas/SublimeText_FullScreenStatus
    // "mde.distraction_free_mode": {
    //  "mde.keep_centered": true
    // }
}

This gives me the macros and other good stuff on the specific files that I choose to use the MarkdownEditing functionality with and get to keep my own familiar environment.

I would basically replace the file(s) with the following changing bits appropriate for the three flavor types:

{

 // -- Uncomment this to automatically use these settings on the following file types -- 

    // "extensions":
    // [
    //  "md",
    //  "mdown",
    //  "txt"
    // ],

 // -- Here are some settings that I really like when using MarkdownEditing

    // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor.tmTheme",
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme",
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Yellow.tmTheme",

    // // This is a quick and dirty focus theme. In order to make it work, you've to
    // // set `"highlight_line": true,` in this settings file. It is likely that there will
    // // be more mature focus improvements in the future (maybe similar to iA Writer).
    // // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Focus.tmTheme",

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

    // // Layout
    // "draw_centered": true,
    // "word_wrap": true,
    // "wrap_width": 80,
    // "rulers": [],

    // // Line
    // "line_numbers": false,
    // "highlight_line": false,
    // "line_padding_top": 2,
    // "line_padding_bottom": 2,

    // // Caret
    // "caret_style": "wide",   // "wide" is deprecated starting with ST Build 3057.
    //                          // In the future, this line will be replaced with:
    //                          //     "caret_style": "solid",
    //                          //     "caret_extra_width": 1,
    // // These will work only in ST Build 3057 and later.
    // "caret_extra_top": 3,
    // "caret_extra_bottom": 3,


 // -- The Following are settings for functionality added specifically by MarkdownEditing

    // // add trailing #'s to headlines
    "mde.match_header_hashes": false,

    // Automatically switches list bullet when indenting blank list item with <Tab>.
    "mde.list_indent_auto_switch_bullet": true,

    // List bullets to be used for automatically switching. In their order.
    "mde.list_indent_bullets": ["*", "-", "+"]

    // // Allways keep current line vertically centered.
    // "mde.keep_centered": false,

    // // Distraction free mode improvements. In order these to work, you have to install
    // // FullScreenStatus plugin: https://github.com/maliayas/SublimeText_FullScreenStatus
    // "mde.distraction_free_mode": {
    //  "mde.keep_centered": true
    // }
}

@adzenith
Copy link

I came here to ask about this same thing. I applied the syntax and thought I would just get nice syntax highlighting. Instead it totally changed around my editor. I would prefer it to do as little as possible visually, like @xguse was saying.

@usamitysam
Copy link

Almost 2 years old and this issue is still open? Came here with the same question.

@fattredd
Copy link

Agreed. It's time to change this. We're going on 4 years now.

@tobek
Copy link

tobek commented Apr 30, 2020

I agree this plugin should be less opinionated about all of these things, especially the color scheme (though they are sensible defaults for markdown editing that many users would want to use so it makes sense to make them available as an option).

As a workaround, just copy the https://github.com/SublimeText-Markdown/MarkdownEditing/blob/master/Markdown.sublime-settings file into <sublime-folder>/Packages/MarkdownEditing/Markdown.sublime-settings and comment out the stuff that you don't want this plugin to override. For example, commenting out the color_scheme setting will let you use whatever color scheme you have set for sublime in general (just make sure you also comment out any settings you set in Packages/User/Markdown.sublime-settings).

Update: I have multiple "Markdown" options when I go to set syntax highlighting for a file, and one of them still has the plugin's overridden colors, but the other appears to have all the functionality of the plugin but doesn't override my scheme and styles. Perhaps my approach makes a duplicate of the plugin, one with my updates and one original as downloaded? Either way I have things working for me here.

@deathaxe
Copy link
Member

I think we should remove those settings.

I'd just keep "trim_trailing_white_space_on_save": false, because 2 spaces at the end of a line denote a line break. So trimming would break file content.

But all other settings are clearly user preferences. If someone doesn't want line numbers or the text being rendered in center, distraction free mode is the way to go. Also don't see any reason for forcing caret style or line paddings.

deathaxe added a commit that referenced this issue May 14, 2021
Fixes #209

Discussion in #209 quite clearly shows the desire of numerous users to
remove settings which feel like hijacking their editor.

Syntax specific settings should be used with care as the only way to
override them is another syntax specific settings file in User package.

The only thing kept is `"trim_trailing_white_space_on_save": false` as
automatic trimming could break hard line breaks (2 spaces at eol).
@deathaxe deathaxe mentioned this issue May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants