This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/nvim/lua/key/Rekey.lua

40 lines
748 B
Lua
Raw Normal View History

2023-08-08 16:24:15 +03:00
local function rekey(t, key, command)
2023-12-05 22:06:39 +03:00
vim.api.nvim_set_keymap(t, key, command, { noremap = true })
2023-08-08 16:24:15 +03:00
end
local function remap(t, key, command)
2023-12-05 22:06:39 +03:00
vim.api.nvim_set_keymap(t, key, command, { noremap = false })
2023-08-08 16:24:15 +03:00
end
function rekey_normal(key, command)
2023-12-05 22:06:39 +03:00
rekey('n', key, command)
2023-08-08 16:24:15 +03:00
end
function rekey_input(key, command)
2023-12-05 22:06:39 +03:00
rekey('i', key, command)
2023-08-08 16:24:15 +03:00
end
function rekey_visual(key, command)
2023-12-05 22:06:39 +03:00
rekey('v', key, command)
2023-08-08 16:24:15 +03:00
end
function rekey_terminal(key, command)
2023-12-05 22:06:39 +03:00
rekey('t', key, command)
2023-08-08 16:24:15 +03:00
end
function remap_normal(key, command)
2023-12-05 22:06:39 +03:00
remap('n', key, command)
2023-08-08 16:24:15 +03:00
end
function remap_input(key, command)
2023-12-05 22:06:39 +03:00
remap('i', key, command)
2023-08-08 16:24:15 +03:00
end
function remap_visual(key, command)
2023-12-05 22:06:39 +03:00
remap('v', key, command)
2023-08-08 16:24:15 +03:00
end
function remap_terminal(key, command)
2023-12-05 22:06:39 +03:00
remap('t', key, command)
2023-08-08 16:24:15 +03:00
end