From a9f1e6186278191ba8ba9c00bc2108ec4e6a97cd Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Sun, 24 Jul 2022 20:22:28 -0600 Subject: [PATCH] Create binds.lua --- neovim/lua/rf/binds.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 neovim/lua/rf/binds.lua diff --git a/neovim/lua/rf/binds.lua b/neovim/lua/rf/binds.lua new file mode 100644 index 0000000..4d4a38b --- /dev/null +++ b/neovim/lua/rf/binds.lua @@ -0,0 +1,20 @@ +local M = {} + +local function bind(operation, outer_operations) + outer_operations = outer_operations or { noremap = true } + return function(l, r, o) + o = vim.tbl_extend('force', + outer_operations, + o or {} + ) + vim.keymap.set(operation, l, r, o) + end +end + +M.nmap = bind('n', { noremap = false }) +M.nnoremap = bind('n') +M.vnoremap = bind('v') +M.xnoremap = bind('x') +M.inoremap = bind('i') + +return M