summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/mango/lib.lua
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-12 23:33:16 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-12 23:33:16 +0200
commit78d2f88b3207f00cac1d5cbe21e00286dec417e8 (patch)
tree7dc06adbc96bf2cbc7627e5f83a1a5fe9783aa97 /.config/nvim/lua/mango/lib.lua
parent30543e85eeae846b83146279e18d00da6c8473a4 (diff)
nvim: Move ‘remap()’ to mango.lib
Diffstat (limited to '.config/nvim/lua/mango/lib.lua')
-rw-r--r--.config/nvim/lua/mango/lib.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/nvim/lua/mango/lib.lua b/.config/nvim/lua/mango/lib.lua
index 71fbc08..4c38986 100644
--- a/.config/nvim/lua/mango/lib.lua
+++ b/.config/nvim/lua/mango/lib.lua
@@ -8,4 +8,14 @@ function M.set_tab_width(tw, localp)
opt.shiftwidth = tw
end
+function M.remap(modes, from, to, opts)
+ local ct = {}
+
+ modes:gsub('.', function(c)
+ table.insert(ct, c)
+ end)
+
+ vim.keymap.set(ct, from, to, opts)
+end
+
return M