local M = {} local function tidy_lhs(lhs) -- nvim_buf_get_keymap replaces leading "<" with "" e.g. "CTRL-v>" lhs = lhs:gsub("^", "<") -- shorten ctrls if lhs:lower():match "^") return lhs end -- sort lhs roughly as per :help index local PAT_MOUSE = "^<.*Mouse" local PAT_CTRL = "^