lukas-reineke / lsp-format.nvim

A wrapper around Neovims native LSP formatting.
564 stars 27 forks source link

clang-format not working #14

Closed alexzanderr closed 2 years ago

alexzanderr commented 2 years ago

i have these:

require "format".setup {
    cpp = {{
            -- cmd = {"clang-format --style='{BasedOnStyle: chromium, IndentWidth: 4}'"}
            cmd = {"clang-format"}
    }},
    c = {{
            cmd = {"clang-format --style='{BasedOnStyle: chromium, IndentWidth: 4}'"}
    }},
}

calling clang-format like this in terminal works like a charm.

but calling from plugin with this config doesnt work.

help.

i've tested for python with black works like a charm and its really fast.

but it doesnt work for cpp/c ... :(

lukas-reineke commented 2 years ago

Not sure TBH, I don't use clang-format

I don't really maintain this plugin anymore. I ported everything I build here to https://github.com/mhartington/formatter.nvim And I am a maintainer over there too.

I'd suggest you switch to use formatter.nvim, and there is a config example for clang-format https://github.com/mhartington/formatter.nvim/blob/master/CONFIG.md#clang-format

alexzanderr commented 2 years ago

I'd suggest you switch to use formatter.nvim

yea, i just did that after raising this issue.

there is a config example for clang-format

i've used that, its very fine.

my question is: is formatter.nvim async like your plugin, format.nvim ?

lukas-reineke commented 2 years ago

my question is: is formatter.nvim async like your plugin, format.nvim ?

Yes it is. Both of them work basically the same, I wrote the async code for both.

alexzanderr commented 2 years ago

very nice. thank you