Skip to content

Latest commit

 

History

History
101 lines (73 loc) · 3.23 KB

README.md

File metadata and controls

101 lines (73 loc) · 3.23 KB

bunnyhop.nvim

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.

Features

Supports Copilot and Hugging Face LLM's

Predicts your next desired cursor position a preview window, allowing you to hop to it via your chosen keybinding.

bunnyhop_feature_1

Installation

Prerequisites

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
},

Configuration

Bunnyhop is configured via the setup() function. The default configuration values can be found here.

Development

Run Tests Locally

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

Common Errors with Local Testing

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.

  1. 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

  1. The test suite assumes that nlua has been installed using luarocks into ~/.luarocks/bin/.