home: vim: prefer 'clangd' to 'clang-format'

Only use `clang-format` if `clangd` is not available, as its formatting
is otherwise built into the LSP server.
This commit is contained in:
Bruno BELANYI 2022-03-02 20:25:42 +01:00
parent 842489a986
commit f2f2b2a98a

View file

@ -9,8 +9,10 @@ null_ls.setup({
-- C, C++
null_ls.register({
null_ls.builtins.formatting.clang_format.with({
-- Only used if available
condition = utils.is_executable_condition("clang-format"),
-- Only used if available, but prefer clangd formatting if available
condition = function()
return utils.is_executable("clang-format") and not utils.is_executable("clangd")
end,
}),
})