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 --- Remove prefix 'nvim-tree: ' --- Hardcoded to keep default_on_attach simple --- @param desc string --- @return string|nil local function tidy_desc(desc) return desc and desc:gsub("^nvim%-tree: ", "") or "" end -- sort lhs roughly as per :help index local PAT_MOUSE = "^<.*Mouse" local PAT_CTRL = "^