Home

Awesome

<div align="center"> <img src="/rabbit.png" width="368" alt="logo"/> <h2 id="rabbitnvim">Jump between buffers faster than ever before</h2> <a href="https://github.com/VoxelPrismatic/rabbit.nvim/releases/latest"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FVoxelPrismatic%2Frabbit.nvim%2Freleases%2Flatest&query=%24.tag_name&style=flat&label=Rabbit&labelColor=white&logo=vowpalwabbit&logoColor=black" /></a> <a href="https://neovim.io/" target="_blank"><img src="https://img.shields.io/badge/Neovim-v0.10.0-brightgreen?style=flat&labelColor=white&logo=neovim&logoColor=black" /></a> <a href="https://github.com/VoxelPrismatic/rabbit.nvim/releases/latest"><img src="https://img.shields.io/github/downloads/voxelprismatic/rabbit.nvim/total?style=flat&logo=github&logoColor=black&label=Downloads&labelColor=white" /></a> <br/> <a href="https://x.com/voxelprismatic" target="_blank"><img src="https://img.shields.io/badge/VoxelPrismatic-white?style=flat&logo=x&logoColor=white&labelColor=black" /></a> <a href="https://discord.com/" target="_blank"><img src="https://img.shields.io/badge/VoxelPrismatic-white?style=flat&logo=discord&logoColor=white&labelColor=blue" /></a> <a href="https://patreon.com/voxelprismatic" target="_blank"><img src="https://img.shields.io/badge/Support-white?style=flat&logo=patreon&logoColor=white&labelColor=red" /></a> <br> <span title="i wish i could customize this, dotfyles"> <a href="https://dotfyle.com/plugins/VoxelPrismatic/rabbit.nvim"><img src="https://dotfyle.com/plugins/VoxelPrismatic/rabbit.nvim/shield?style=social" /></a> </span> <hr/> </div>

This tool tracks the history of buffers opened in an individual window. With a quick motion, you can be in any one of your last twenty buffers without remembering any details.

Unlike other tools, this remembers history per window, so you can really jump quickly.

Why

Harpoon

Telescope

:ls and :b

And this too...

None of these solutions actually support split screen. You must remember all the details yourself.

Install

Lazy:

return {
    "voxelprismatic/rabbit.nvim",
    config = function()
        require("rabbit").setup({{opts}})     -- Detailed below
    end,
}

[!WARNING] Rabbit is only tested on Linux, although probably works as well on macOS. Please help with any compatibility issues by raising an issue

[!NOTE] Rabbit is only tested on the latest version of Neovim, which is detailed at the top of the ReadMe. If your version of Neovim is significantly older, bite the bullet and upgrade.

Usage

Just run your keybind! (or :Rabbit {{mode}})

With Rabbit open, you can hit a number 1-9 to jump to that buffer. You can also move your cursor down to a specific line and hit enter to jump to that buffer.

If you hit <CR> immediately after launching Rabbit, it'll open your previous buffer. You can hop back and forth between buffers very quickly, almost like a rabbit...

If you scroll down on the Rabbit window, you'll see all the keybinds available.

Preview

2024-05-30 15-36-13.webm

Configuration

[!NOTE] Be sure to use an LSP, like lua_ls. I have all the types created for your convenience.

<details> <summary><b>Rabbit.Options</b></summary>
keytypedescriptiondefault
colorsRabbit.Options.ColorsColors used by Rabbit{ ... }
windowRabbit.Options.WindowWindow options{ ... }
default_keysRabbit.KeymapKeys and things{ ... }
plugin_optsRabbit.Options.Plugin_OptionsPlugin options{ ... }
enablestring[]Which builtin plugins to enable immediately<br>*first plugin is considered defaulthistory,<br/>reopen,<br/>oxide,<br/>harpoon

<br><br>

</details> <details> <summary><b>Rabbit.Options.Colors</b></summary>

image

keytypedescriptiondefault
titlestring | NvimHlKwargsTitle text#526091,<br>bold
indexstring | NvimHlKwargsIndex#7581ab,<br>italic
dirstring | NvimHlKwargsDirectory#9396bd
filestring | NvimHlKwargsFile#526091
termstring | NvimHlKwargsTerminal#40c9a2,<br>italic
nonamestring | NvimHlKwargsNo Name#d08e95,<br>italic
messagestring | NvimHlKwargsMessage#8aaacd,<br>bold ital

note: default colors listed here are from my color theme. rabbit will automatically pull your color theme using several highlight groups, eg Normal or Comment

<br><br>

</details> <details> <summary><b>Rabbit.Options.Window</b></summary>

image

keytypedescriptiondefault
boxRabbit.BoxBorder boxRound
box_style"round" | "thick" | <br>"square" | "double"Border box styleround
titlestringThe plugin title, if you don't like RabbitRabbit
widthintegerWindow width64
heightintegerWindow height24
overflowstringCharacters to display when the dir path is too long:::
path_lenintegerMaximum length of a path segment12
float{ "bottom" | "top",<br>"left", "right" }<br>| "center"<br>| falseFloating position. If set to false, will try to split<br>note: bottom or top must precede left or right{ "bottom", "right" }
split"left" | "right" |<br>"above" | "below" |<br>falseSplit window position. If set to false, will occupy full screen. Only available if float is set to falseright
plugin_name_position"bottom" | "title" | "hide"Where to place the plugin namebottom

<br><br>

</details> <details> <summary><b>Rabbit.Box</b></summary>
keytypedescription
top_leftstringTop left corner of the box
top_rightstringTop right corner of the box
horizontalstringHorizontal ceiling
verticalstringVertical wall
bottom_leftstringBottom left corner of the box
bottom_rightstringBottom right corner of the box
emphasisstringTitle emphasis character

<br><br>

</details> <details> <summary><b>Rabbit.Keymap</b></summary>
keytypedescriptiondefault
closestring[]Keys to close Rabbit<Esc>, q, <leader>
selectstring[]Keys to select an entry<Enter>
openstring[]Keys to open Rabbit<br>this is how Rabbit will open<leader>r
file_addstring[]Keys to add the current file to a collectiona
file_delstring[]Keys to delete the current file from a collection<Del>
groupstring[]Keys to create a new collectionA
group_upstring[]Keys to move to the parent collection-

<br><br>

</details> <details> <summary><b>Rabbit.Options.Plugin_Options</b></summary>

Note: The key should be the plugin name, with the value being the table described below

keytypedescriptionexample
colorstringBorder color#00ffff
switchstringKey to switch to this plugin from within Rabbito
optstableAny plugin-specific options. My documentation is available in the wiki{}

<br><br>

</details> <details> <summary><b>Default config</b></summary>

Please do not copy this config, it is the default.

-- Use all the below defaults, but set a custom keybind
require("rabbit").setup("any keybind")

-- Defaults
require("rabbit").setup({
    colors = {
        title = { fg = grab_color("Normal"), bold = true },
        index = { fg = grab_color("Comment"), italic = true },
        dir = { fg = grab_color("NonText") },
        file = { fg = grab_color("Normal") },
        term = { fg = grab_color("Constant"), italic = true },
        noname = { fg = grab_color("Function"), italic = true },
        message = { fg = grab_color("Identifier"), italic = true, bold = true },
    },
    window = {
        box = box.round,
        title = "Rabbit",
        plugin_name_position = "bottom",
        emphasis_width = 8,
        width = 64,
        height = 24,
        float = {
            "bottom",
            "right",
        },
        split = "right",
        overflow = ":::",
        path_len = 12,
    },
    default_keys = {
        close = { "<Esc>", "q", "<leader>" },
        select = { "<CR>" },
        open = { "<leader>r" },
        file_add = { "a" },
        file_del = { "<Del>" },
        group = { "A" },
        group_up = { "-" },
    },
    plugin_opts = {},
    enable = {
        "history",
        "reopen",
        "oxide",
        "harpoon",
    },
})
</details>