1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 19:30:01 +02:00
dotfiles/nvim/lua/utils/keys.lua

13 lines
327 B
Lua

return function(v, opts)
local c = vim.deepcopy(v)
local lhs = table.remove(c, 1)
local rhs = table.remove(c, 1)
opts = vim.tbl_deep_extend("force", c, opts or {})
local mode = 'n'
if opts.mode then
mode = opts.mode
opts.mode = nil
end
vim.keymap.set(mode, lhs, rhs, opts)
end