Create binds.lua

This commit is contained in:
Rawley Fowler 2022-07-24 20:22:28 -06:00 committed by GitHub
parent 189dce1e06
commit a9f1e61862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

20
neovim/lua/rf/binds.lua Normal file
View file

@ -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