diff --git a/home-manager/base/nixvim/plugins/fmt.nix b/home-manager/base/nixvim/plugins/fmt.nix index 4a0efec..88220d0 100644 --- a/home-manager/base/nixvim/plugins/fmt.nix +++ b/home-manager/base/nixvim/plugins/fmt.nix @@ -21,27 +21,22 @@ }; settings = { default_format_opts.lsp_format = "fallback"; - format_on_save = '' - function(bufnr) - local disable_filetypes = { c = true, cpp = true } - local lsp_format_opt - if disable_filetypes[vim.bo[bufnr].filetype] then - lsp_format_opt = 'never' - else - lsp_format_opt = 'fallback' - end - return { - timeout_ms = 500, - lsp_format = lsp_format_opt, - } - end - ''; + format_on_save = { + lsp_format = "fallback"; + timeout_ms = 500; + }; formatters_by_ft = { + c = [ "clang-format" ]; lua = [ "stylua" ]; nix = [ "nixfmt" ]; python = [ "ruff" ]; }; + + formatters.clang-format.prepend_args = [ + "--style=file" + "--fallback-style=LLVM" + ]; }; }; diff --git a/home-manager/base/nixvim/plugins/lsp.nix b/home-manager/base/nixvim/plugins/lsp.nix index 6a6c816..a80764b 100644 --- a/home-manager/base/nixvim/plugins/lsp.nix +++ b/home-manager/base/nixvim/plugins/lsp.nix @@ -51,13 +51,7 @@ installCargo = false; installRustc = false; }; - qmlls = { - enable = true; - cmd = [ - "qmlls" - "-E" - ]; - }; + clangd.enable = true; }; }; };