local M = {} M.map = { m = "h", n = "j", e = "k", i = "l", h = "i", j = "n", k = "m", l = "e", } M.modes = { "n", "v", "x", "s", "o", } local mods = { "") end return out end local function set(lhs, rhs) vim.keymap.set(M.modes, lhs, rhs, { noremap = true }) end M.init = function() local out = {} for lhs, rhs in pairs(M.map) do local lhs_perms = get_permutations(lhs) local rhs_perms = get_permutations(rhs) for i, l in ipairs(lhs_perms) do local r = rhs_perms[i] out[l] = r set(l, r) end end -- vim.keymap.set("n", "n", "j") return out end return M