local bufnr = vim.api.nvim_get_current_buf() local function map(mode, lhs, rhs, opts) opts = opts or {} opts.buffer = bufnr opts.silent = true vim.keymap.set(mode, lhs, rhs, opts) end map('n', 'ra', 'RustLsp codeAction', { desc = 'Code [A]ction' }) map('n', 'rr', 'RustLsp run', { desc = '[R]un' }) map('n', 'rR', 'RustLsp runnables', { desc = '[R]unnables' }) map('n', 'rd', 'RustLsp debug', { desc = '[D]ebug' }) map('n', 'rD', 'RustLsp debuggables', { desc = '[D]ebuggables' }) map('n', 'rt', 'RustLsp testables', { desc = '[T]estables' }) map('n', 're', 'RustLsp explainError', { desc = '[E]xplain Error' }) map('n', 'ri', 'RustLsp renderDiagnostic', { desc = 'Show Next D[i]agnostic' }) map('n', 'ro', 'RustLsp openCargo', { desc = '[O]pen Cargo.toml' })