From fb3c96d50d625db725940625120012c75afc17f6 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Fri, 14 Jun 2024 19:06:50 +0200 Subject: feat: Initial commit --- lua/gabrielgio/key.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lua/gabrielgio/key.lua (limited to 'lua/gabrielgio/key.lua') diff --git a/lua/gabrielgio/key.lua b/lua/gabrielgio/key.lua new file mode 100644 index 0000000..ed683b1 --- /dev/null +++ b/lua/gabrielgio/key.lua @@ -0,0 +1,24 @@ +local function bind(op, outer_opts) + local outer_opts0 = (outer_opts or {noremap = true}) + local function lo(lhs, rhs, opts) + local opts0 = vim.tbl_extend("force", outer_opts0, (opts or {})) + return vim.keymap.set(op, lhs, rhs, opts0) + end + return lo +end + +local nmap = bind("n", {noremap = false}) +local nnoremap = bind("n") +local vnoremap = bind("v") +local xnoremap = bind("x") +local inoremap = bind("i") +local tnoremap = bind("t") + +return { + nmap = nmap, + nnoremap = nnoremap, + tnoremap = tnoremap, + vnoremap = vnoremap, + xnoremap = xnoremap, + inoremap = inoremap +} -- cgit v1.2.3