2022-09-12 13:48:29 +02:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
local function swap(key)
|
2022-12-14 03:20:59 +01:00
|
|
|
vim.keymap.set({ "n", "v" }, key, "g" .. key, { buffer = true })
|
|
|
|
vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true })
|
2022-09-12 13:48:29 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Same as swap, but the key is aprt of an arpeggio chord
|
|
|
|
local function swapArpeggio(key)
|
2022-12-14 03:20:59 +01:00
|
|
|
vim.keymap.set({ "n", "v" }, "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key,
|
|
|
|
{ buffer = true })
|
|
|
|
vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true })
|
2022-09-12 13:48:29 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function M.setup()
|
|
|
|
swapArpeggio("j")
|
|
|
|
swap("k")
|
|
|
|
swap("0")
|
|
|
|
swap("$")
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|