hop.nvim
hop.nvim copied to clipboard
Is there a way to implement some "post jump hooks"?
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
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.
Imagine the animations you could do with both a prehop and a posthop callback ;)
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
There is hint_with_callback. Is that enough for you?