-- LazyVim's ai.claudecode extra maps "a" (group) and "as" (Send to -- Claude) with mode "v", which also covers Select mode. A space typed over a -- Shift+arrow selection (selectmode=key) then waits 'timeoutlen' for the rest of -- a map instead of replacing the selection at once. Keep those maps in -- Visual mode only ("x"); Visual as behaves exactly as before. return { { "coder/claudecode.nvim", optional = true, keys = function(_, keys) local function visual_only(mode) if mode == "v" then return "x" end if type(mode) == "table" then return vim.tbl_map(function(m) return m == "v" and "x" or m end, mode) end return mode end return vim.tbl_map(function(k) if type(k) ~= "table" or k.mode == nil then return k end return vim.tbl_extend("force", k, { mode = visual_only(k.mode) }) end, keys) end, }, }