diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 5a8fb1b4..cea2ef1d 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -46,13 +46,11 @@ return { ft = { "rust" }, opts = { server = { - on_attach = function(client, bufnr) - -- register which-key mappings - local wk = require("which-key") - wk.register({ - ["cR"] = { function() vim.cmd.RustLsp("codeAction") end, "Code Action" }, - ["dr"] = { function() vim.cmd.RustLsp("debuggables") end, "Rust debuggables" }, - }, { mode = "n", buffer = bufnr }) + on_attach = function(_, bufnr) + vim.keymap.set("n", "cR", function() vim.cmd.RustLsp("codeAction") end, + { desc = "Code Action", buffer = bufnr }) + vim.keymap.set("n", "dr", function() vim.cmd.RustLsp("debuggables") end, + { desc = "Rust debuggables", buffer = bufnr }) end, default_settings = { -- rust-analyzer language server configuration @@ -128,4 +126,4 @@ return { end }, -} \ No newline at end of file +}