Mini Jump2d remote action #1755
leath-dub
started this conversation in
Show and tell
Replies: 1 comment 5 replies
-
Thanks for sharing! I haven't tried this, but one area I noticed might need an improvement is that it seems to only work in a current window (while jumping to other windows is possible). I do have plans to upgrade 'mini.jump2d' some time in the future. This would include changing default options (to dim and showing 1 step ahead) and spotter. Not quite sure yet to which one: currently testing Probably will also add the "remote action" feature, as it indeed might be useful from time to time. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is a feature from flash.nvim that is really useful. Essentially you can start a operator, for example "y", and type "r" (for remote), this will open mini jump2d. Once you make are brought to the desired location, you will be still in operator pending mode and you can type any motion, like for example "w". Once this motion has been typed, you will be returned back to where you were before you started jumping and in this example you would have yanked the word starting at where you jumped to.
This is a bit hacky, but it can be done by saving the pending operator, jumping, and re applying the pending operator on the range applied to the custom "g@" operator.
First we need a global operator function to assign each time we want to do a remote jump:
Then just set a operator pending key to trigger the jumping when there is a pending operator (in this case the "r" key):
Beta Was this translation helpful? Give feedback.
All reactions