From 994d9f6c301e706fcbaed06a3962a761c1175789 Mon Sep 17 00:00:00 2001 From: Tummetott <19708025+Tummetott@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:55:16 +0100 Subject: [PATCH] added wrapper functions which can be used to define count prefixed, dot repeatable keymaps --- lua/iswap.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lua/iswap.lua b/lua/iswap.lua index e874faa..9ee90a4 100644 --- a/lua/iswap.lua +++ b/lua/iswap.lua @@ -331,4 +331,30 @@ function M.iswap_with(direction, config) vim.cmd([[silent! call repeat#set("\ISwapWith", -1)]]) end +-- The following are convenience wrapper functions which can be used in dot +-- repeatable keymaps. Keymaps are also capable to be prefixed with [count] +function M.iswap_with_left() + for _ = 1, vim.v.count1 do + require('iswap').iswap_with('left') + end +end + +function M.iswap_with_right() + for _ = 1, vim.v.count1 do + require('iswap').iswap_with('right') + end +end + +function M.iswap_node_with_left() + for _ = 1, vim.v.count1 do + require('iswap').iswap_node_with('left') + end +end + +function M.iswap_node_with_right() + for _ = 1, vim.v.count1 do + require('iswap').iswap_node_with('right') + end +end + return M