stevearc / conform.nvim

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

question: #358

Open rongbozhu opened 4 months ago

rongbozhu commented 4 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 3 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" },
},