-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dot repeatable #68
Comments
I managed to get dot repetition as following: I created a file called local M = {}
M.swap_left = function()
require('iswap').iswap_node_with('left')
end
M.swap_right = function()
require('iswap').iswap_node_with('right')
end
return M Then i created keymaps in my plugin config: vim.keymap.set(
'n',
'[s',
function ()
vim.go.operatorfunc = "v:lua.require'wrapper'.swap_left"
return 'g@l'
end,
{ desc = 'Swap with left node', expr = true }
)
vim.keymap.set(
'n',
']s',
function ()
vim.go.operatorfunc = "v:lua.require'wrapper'.swap_right"
return 'g@l'
end,
{ desc = 'Swap with right node', expr = true }
)
The wrapper functions are needed since @mizlan maybe you can add the following functions for convenience? require('iswap').iswap_with_left()
require('iswap').iswap_with_right()
require('iswap').iswap_node_with_left()
require('iswap').iswap_node_with_right() Then users could define keymaps directly and does not have to define wrapers themself |
Thank you for studying this issue @tummetott, I can finally repeat this operation. |
Oh I totally forgot about this tbh. I'm quite busy atm but I'll look into this as soon as I have a little more time. Should not be hard to implement |
Actually it looks like you already implemented it, thank you for your work |
No I didn't. @mizlan expressed his wish to include all the boilerplate code into the plugin. The PR I suggested needs some polishing |
It would be nice if commands like
:ISwapNodeWithLeft
could be made dot repeatable.The text was updated successfully, but these errors were encountered: