Hop across your code at lightning speed ⚡️⚡️⚡️
Note
This plugin is in alpha version, expect bugs, lacking features and documentation. If you found a bug, reporting it would be appriciated, while fixing it via a pull request would be greatly appriciated.
Predicts your next desired cursor position a preview window, allowing you to hop to it via your chosen keybinding.
The only provider supported currently is Hugging Face's Serverless.
Hence, Hugging Face's API key is required. Learn how to set it up here.
Once you have you're API key, create an enviornment variable for the key, eg. export HF_API_KEY=************
{
"PLAZMAMA/bunnyhop.nvim",
lazy = false, -- This plugin does not support lazy loading for now
-- Setting the keybinding for hopping to the predicted location.
-- Change it to whatever suits you.
keys = {
{
"<C-h>",
function()
require("bunnyhop").hop()
end,
desc = "[H]op to predicted location.",
},
},
-- The only options currently required is the api_key.
-- Set it to the enviornment variable name of your hugging face API key.
opts = { api_key = "HF_API_KEY" },
},
Bunnyhop is configured via the setup() function. The default configuration values can be found here.
Running tests requires either
to be installed1.
You can then run:
luarocks test --local
# or
busted
Or if you want to run a single test file:
luarocks test spec/path_to_file.lua --local
# or
busted spec/path_to_file.lua
Note
For The local testing to work you need to have Lua 5.1 set as your default version for luarocks.
If that's not the case you can pass --lua-version 5.1
to all the luarocks commands above.
- If you see an error like
module 'busted.runner' not found
run the following command:
This sets the correct luarocks path.
eval $(luarocks path --no-bin)
Footnotes
-
The test suite assumes that
nlua
has been installed using luarocks into~/.luarocks/bin/
. ↩