From 11b04ad1e5ef81d42c4384af94d7ba4161f0c160 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Appel Date: Tue, 21 Feb 2023 01:04:26 -0500 Subject: Added nvim and tmux config --- nvim/lua/keymap.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 nvim/lua/keymap.lua (limited to 'nvim/lua/keymap.lua') diff --git a/nvim/lua/keymap.lua b/nvim/lua/keymap.lua new file mode 100644 index 0000000..883321b --- /dev/null +++ b/nvim/lua/keymap.lua @@ -0,0 +1,22 @@ +-- Provides convienent lua methods for binding keys +-- Source: Primeagen +local M = {} + +local function bind(op, outer_opts) + outer_opts = outer_opts or {noremap = true} + return function(lhs, rhs, opts) + opts = vim.tbl_extend("force", + outer_opts, + opts or {} + ) + vim.keymap.set(op, lhs, rhs, opts) + 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 -- cgit v1.2.3