Skip to content

Support for new standard "format" key #197

Description

@iamFIREcracker

How open would you be to adding support for a new "format" key, to allow users define formatters (in the formatprg and formatexpr sense)? I have a working prototype on my local, and if you were not against this in principle, I could mop it up and open a PR for it.

High level, this is what I got so far:

  • New "format" key; its value can either a string or a list of strings
    • Note: when formatting Python files, you might end up using black together with isort; I figured it would be easier to support this (i.e., multiple formatters) rather than forcing users to define custom scripts running all the required formatters
  • If available, the local formatexpr will be overwritten with a function that would cycle through and run all the defined formatters for the buffer (e.g., selection -> formatter 1 -> formatter 2 -> formatter 3 ...)

Any thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions