Skip to content

feature request: exclude * filetype from formatting with fallback #846

@gegoune

Description

@gegoune

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

lsp_format set to fallback (recommended setting) together with * configured means that no LSP formatting will ever be used.

It can be worked around by specifically overriding lsp_format, for example like so:

    dockerfile = { lsp_format = 'last' },

This has to be repeated for every filetype that has corresponding LSP with formatting capability configured.

I would like an option, or perhaps another value for lsp_format that would cause formatters configured by * to be excluded from fallback behaviour, removing the need for aforementioned workaround.

Provide background

I consider * filetype (catch-all) formatters to be 'cherry on top` rather than fundamental formatters filetypes should be associated with. I personally use:

    ['*'] = { 'squeeze_blanks', 'trim_newlines', 'trim_whitespace' },

and it means 'workaround` is required to have LSP formatting.

(I know there is _ key, but I still want those three formatters to work with every single filetype as not all formatters perform those actions.)

What is the significance of this feature?

nice to have

Additional details

What do you think about it? Or am I doing something wrong in the first place?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions