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.
Either Copilot(Recommenced) or Hugging Face's Serverless.
- For Copilot, you only need to set it up via copilot.lua or copilot.vim.
- For Hugging Face, an API key is required. Learn how to set it up here. Once you have the 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.",
},
},
opts = {}, -- if using copilot
-- Or
-- opts = {adapter = "hugging_face", api_key = "HF_API_KEY", model = "Qwen/Qwen2.5-Coder-32B-Instruct"}, -- if using hugging face
},
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
If you encounter the module 'busted.runner' not found
or pl.path requires LuaFileSystem
errors, fix it by
runing the following command the following command:
eval $(luarocks path --no-bin)
If you encounter sh: nlua: command not found
error the error above occurs do1:
Run the following command:
export PATH=$PATH:~/.luarocks/bin
See the following guide to a variable to the PATH: add to PATH.
Note
For 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, or set lua version 5.1 globally by running
luarocks config --scope system lua_version 5.1
.
- Thank you Oli Morris for encoraging me to make to plugin.
- Cursor for the inspiration for this plugin.