gabrielgio.lua @ eca140c8a12198c45b9abaefa8aa186686957ab1

 1local function bind(op, outer_opts)
 2    local outer_opts0 = (outer_opts or {noremap = true})
 3    local function lo(lhs, rhs, opts)
 4        local opts0 = vim.tbl_extend("force", outer_opts0, (opts or {}))
 5        return vim.keymap.set(op, lhs, rhs, opts0)
 6    end
 7    return lo
 8end
 9
10local nmap = bind("n", {noremap = false})
11local nnoremap = bind("n")
12local vnoremap = bind("v")
13local xnoremap = bind("x")
14local inoremap = bind("i")
15local tnoremap = bind("t")
16
17return {
18    nmap = nmap,
19    nnoremap = nnoremap,
20    tnoremap = tnoremap,
21    vnoremap = vnoremap,
22    xnoremap = xnoremap,
23    inoremap = inoremap
24}