fix rust fmt

This commit is contained in:
xfy
2025-04-02 13:29:55 +08:00
parent 51480b43ef
commit df426d2d9e

View File

@ -25,12 +25,16 @@ return {
python = { "isort", "black" }, python = { "isort", "black" },
php = { "intelephense" }, php = { "intelephense" },
c = { "clang-format" }, c = { "clang-format" },
rust = { "rustfmt", lsp_format = "fallback" },
-- Use the "*" filetype to run formatters on all filetypes. -- Use the "*" filetype to run formatters on all filetypes.
["*"] = { "codespell" }, -- ["*"] = { "codespell" },
-- Use the "_" filetype to run formatters on filetypes that don't -- Use the "_" filetype to run formatters on filetypes that don't
-- have other formatters configured. -- have other formatters configured.
["_"] = { "trim_whitespace" }, ["_"] = { "trim_whitespace" },
}, },
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = function(bufnr) format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable -- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then