stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
2.72k stars 142 forks source link

How to add new formatter ? #381

Closed mrt181 closed 3 months ago

mrt181 commented 3 months ago

Did you check existing requests?

Describe the feature

I would like to a add dotnet format that uses .editorconfig as a formatter. The documentation only mentions configuring existing formatters. Can a new one be added?

Provide background

No response

What is the significance of this feature?

strongly desired

Additional details

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format https://github.com/dotnet/format

stevearc commented 3 months ago

The options section documents all the possible configurations options for a formatter (under the formatters key). All you have to do is create a file under lua/conform/formatters that returns a lua table with the values that make sense for your formatter. There are a lot of example PRs to look at as well. Note that some of them update the docs, but all you have to do is add the new formatter file. The docs will get updated automatically.