1
Fork 0
satellite/dotfiles/neovim/lua/my/helpers/wrapMovement.lua

23 lines
551 B
Lua
Raw Normal View History

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 })
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 })
end
function M.setup()
swapArpeggio("j")
swap("k")
swap("0")
swap("$")
end
return M