2022-07-30 07:17:12 +02:00
|
|
|
local function map(mode, shortcut, command, opt)
|
2022-10-11 07:40:50 +02:00
|
|
|
vim.keymap.set(mode, shortcut, command, opt)
|
2022-07-30 07:17:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Nmap(shortcut, command, opt)
|
2022-10-11 07:40:50 +02:00
|
|
|
opt = opt or { noremap = true, silent = true }
|
|
|
|
map("n", shortcut, command, opt)
|
2022-07-30 07:17:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Imap(shortcut, command, opt)
|
2022-10-11 07:40:50 +02:00
|
|
|
opt = opt or { noremap = true, silent = true }
|
|
|
|
map("i", shortcut, command, opt)
|
2022-07-30 07:17:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function Xmap(shortcut, command, opt)
|
2022-10-11 07:40:50 +02:00
|
|
|
opt = opt or { noremap = true, silent = true }
|
|
|
|
map("x", shortcut, command, opt)
|
2022-07-30 07:17:12 +02:00
|
|
|
end
|