Skip to content

🐰 Bookmarks menu for yazi with persistent and ephemeral bookmarks, fuzzy searching, previous directory, directory from another tab

License

Notifications You must be signed in to change notification settings

stelcodes/bunny.yazi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

bunny.yazi 🐰

🩷 Hop around your filesystem 🩷

This is a bookmark plugin for yazi which augments the builtin bookmarking abilities into a single menu of cd powers designed with user experience (and cuteness) in mind. Bookmarks are referred to as hops because users should always feel adorable while using their terminal.

Features

  • Create persistent hops in your init.lua config file (lowercase letters only)
  • Create ephemeral hops while using yazi (uppercase letters only)
  • Hop to any directory open in another tab
  • Hop back to previous directory (history is associated with tab number)
  • Hop by fuzzy searching available hops with fzf or similar program
  • Single menu for all functionality, therefore only one keymap is required in your keymap.toml file
  • Hands off: no reads or writes to your filesystem, all state is kept in memory

bunny.yazi menu open in a terminal

Installation

With git

git clone https://github.com/stelcodes/bunny.yazi ~/.config/yazi/plugins/bunny.yazi

With yapack

ya pack -a stelcodes/bunny

With Nix (Home Manager + flakes)

flake.nix:

inputs = {
  bunny-yazi = {
    url = "github:stelcodes/bunny.yazi";
    flake = false;
  };
};

Home Manager config:

programs.yazi = {
  plugins.bunny = "${inputs.bunny-yazi}";
  initLua = ''
    require("bunny"):setup({ ... })
  '';
  keymap.manager.prepend_keymap = [
    { on = ";"; run = "plugin bunny"; desc = "Start bunny.yazi"; }
  ];
};

Configuration

~/.config/yazi/init.lua:

require("bunny"):setup({
  hops = {
    { key = "r",          path = "/",                                    },
    { key = "v",          path = "/var",                                 },
    { key = "t",          path = "/tmp",                                 },
    { key = "n",          path = "/nix/store",     desc = "Nix store"    },
    { key = { "h", "h" }, path = "~",              desc = "Home"         },
    { key = { "h", "m" }, path = "~/Music",        desc = "Music"        },
    { key = { "h", "d" }, path = "~/Documents",    desc = "Documents"    },
    { key = { "h", "k" }, path = "~/Desktop",      desc = "Desktop"      },
    { key = "c",          path = "~/.config",      desc = "Config files" },
    { key = { "l", "s" }, path = "~/.local/share", desc = "Local share"  },
    { key = { "l", "b" }, path = "~/.local/bin",   desc = "Local bin"    },
    { key = { "l", "t" }, path = "~/.local/state", desc = "Local state"  },
    -- key and path attributes are required, desc is optional
  },
  desc_strategy = "path", -- If desc isn't present, use "path" or "filename", default is "path"
  notify = false, -- Notify after hopping, default is false
  fuzzy_cmd = "fzf", -- Fuzzy searching command, default is "fzf"
})

~/.config/yazi/yazi.toml:

[[manager.prepend_keymap]]
desc = "Start bunny.yazi"
on = ";"
run = "plugin bunny"

Inspiration

yamb.yazi

nnn bookmarks

About

🐰 Bookmarks menu for yazi with persistent and ephemeral bookmarks, fuzzy searching, previous directory, directory from another tab

Resources

License

Stars

Watchers

Forks

Packages

No packages published