Skip to content

do not automatically set user preferences like ts,sw,et #20036

@bugsbugsbux

Description

@bugsbugsbux

Please do not automatically set user preferences like tab settings
unless there is a really good reason to do so!

Problem:
Constantly my config settings are overwritten by runtime/{ftplugin,indent}files for no good reason.
Undoing this is bothersome, because if i set sw=0 in my config i expect to be able to set ts=whatever and then indent with this new indent, but now i have to also set sw=0 again!

These are user preferences, so respect that. Setting these is explicitly against vim's own guidelines, as stated in
https://github.com/vim/vim/blob/cee8fd7/runtime/ftplugin/README.txt
which even mentions shiftwidth by name as not to be set automatically!

For example, markdown requires opting out of their default settings,
typst does not even provide these opt out wrappers!

Moreover, these default settings are hard to discover:
typst scatters them over multiple files like runtime/{ftplugin,indent,autoload},
while markdown puts them all into ftplugin.
If you set sw=0 and on FileType markdown ts=8 in your config,
then you get no indication why tabs are not 8 characters,
even if you :verbose set ts?

The only valid reason for setting such settings is if
they are actually required by the filetype,
like tsv and make expecting real \t thus setting noexpandtab.

Given that there is a clear guideline how to go about this correctly,
I consider this a BUG and
request that all such settings are not automatically set,
preference wrappers like if get(g:, 'markdown_recommended_style', 1) default to false
and a notification be shown instead,
notifying the user of how to enable these recommendations
(like FileType markdown: enable recommendations with :let g:markdown_recommended_style=1 or disable this notification with :let g:markdown_notify_recommendations=0)

Furthermore, there needs to be some way to ensure this is enforced,
because clearly not even the maintainers reviewing ft specific pull requests
seem to remember the rules or at least demand consistency (at least whether
everything is in runtime/ftplugin or split up into runtime/indent etc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions