From df426d2d9e65fd58b9a865add9b2b2cdb6bd3c2b Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 2 Apr 2025 13:29:55 +0800 Subject: [PATCH] fix rust fmt --- lua/rua/plugins/formatting.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/rua/plugins/formatting.lua b/lua/rua/plugins/formatting.lua index 1b87182..edcb679 100644 --- a/lua/rua/plugins/formatting.lua +++ b/lua/rua/plugins/formatting.lua @@ -25,12 +25,16 @@ return { python = { "isort", "black" }, php = { "intelephense" }, c = { "clang-format" }, + rust = { "rustfmt", lsp_format = "fallback" }, -- Use the "*" filetype to run formatters on all filetypes. - ["*"] = { "codespell" }, + -- ["*"] = { "codespell" }, -- Use the "_" filetype to run formatters on filetypes that don't -- have other formatters configured. ["_"] = { "trim_whitespace" }, }, + default_format_opts = { + lsp_format = "fallback", + }, format_on_save = function(bufnr) -- Disable with a global or buffer-local variable if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then