Revamped config

This commit is contained in:
2024-03-22 18:14:16 +01:00
parent 4ee74dddf2
commit 980e542a2c
9 changed files with 103 additions and 93 deletions

34
lua/taken/utils/maps.lua Normal file
View File

@@ -0,0 +1,34 @@
local M = {}
local set = vim.keymap.set
function M.setmap(maps)
local v = maps.v or {}
local n = maps.n or {}
local vn = maps.vn or {}
for map, command in pairs(v) do
if command.desc then
set("v", map, command[1], { desc = command.desc, silent = true })
else
set("v", map, command[1], { silent = true })
end
end
for map, command in pairs(n) do
if command.desc then
set("n", map, command[1], { desc = command.desc, silent = true })
else
set("n", map, command[1], { silent = true })
end
end
for map, command in pairs(vn) do
if command.desc then
set({ "v", "n" }, map, command[1], { desc = command.desc, silent = true })
else
set({ "v", "n" }, map, command[1], { silent = true })
end
end
end
return M