hop.nvim icon indicating copy to clipboard operation
hop.nvim copied to clipboard

Is there a way to implement some "post jump hooks"?

Open DEliasVCruz opened this issue 3 years ago • 4 comments
trafficstars

Basically I want to call a function after hop has jumped and landed on my target. I'm using the specs plugin to as a cursor beam and I want to call it after every. And if I try to map it like this:

"<cmd>lua require('hop').hint_lines({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR })<cr><cmd>lua require('specs').show_specs()<cr>"

It does not wait for me to select my target and before executing the specs command, Even if there was a way to configure my mapping so that it works as intended. It would be nicer if I could just put it in the config and expect it to happen with every command

DEliasVCruz avatar Mar 17 '22 18:03 DEliasVCruz

Oh yeah, it’s planned and shouldn’t be too hard to do. Callbacks have been wanted for a while, so I’m going to invest some time in it soon.

hadronized avatar Mar 18 '22 07:03 hadronized

Imagine the animations you could do with both a prehop and a posthop callback ;)

clason avatar Mar 18 '22 09:03 clason

Maybe this would help achieve what you want https://www.reddit.com/r/neovim/comments/us4x7d/vim_commands_with_easy_motion_using_nvim_hop_and/?utm_source=share&utm_medium=ios_app&utm_name=iossmf

darzok0914 avatar May 27 '22 01:05 darzok0914

There is hint_with_callback. Is that enough for you?

hadronized avatar Jun 21 '22 11:06 hadronized