stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
3.19k stars 163 forks source link

question: #358

Open rongbozhu opened 7 months ago

rongbozhu commented 7 months ago

Did you check existing requests?

Describe the feature

How use clang-format to set the format style?such as google or microsoft.I have set the args = { "-assume-filename", "$FILENAME", "--style=Microsoft" },but it didn't work.My configration for conform is that : require("conform").setup({ formatters = { clang_format = { command = "clang-format", args = { "-assume-filename", "$FILENAME", "--style=Microsoft" }, }, )}

Provide background

No response

What is the significance of this feature?

nice to have

Additional details

No response

nonotran68 commented 7 months ago

your lua config might seem wrong. Maybe it's lilke that

require("conform").setup({
formatters_by_ft = {
  cpp = { "clang-format" },
},
formatters = {
  ["clang-format"]= {
    prepend_args = { "-style", "Microsoft" },
  },
}