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