Skip to content
/ yamb.yazi Public

Yet another bookmarks plugins. It supports persistence, jumping by a key, jumping by fzf.

License

Notifications You must be signed in to change notification settings

h-hg/yamb.yazi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Yet another bookmarks

A Yazi plugin for bookmark management, supporting the following features

  • Persistent bookmarks. No bookmarks are lost after you close yazi.
  • Quickly jump, delete, and rename a bookmark by keymap.
  • Support fuzzy search through fzf.
  • Configure your bookmarks using Lua language.

Installation

Note

Yazi >= 0.25.

# Linux/macOS
git clone https://github.com/h-hg/yamb.yazi.git ~/.config/yazi/plugins/yamb.yazi

# Windows
git clone https://github.com/h-hg/yamb.yazi.git $env:APPDATA\yazi\config\plugins\yamb.yazi

Usage

Add this to your init.lua

-- You can configure your bookmarks by lua language
local bookmarks = {}

local path_sep = package.config:sub(1, 1)
local home_path = ya.target_family() == "windows" and os.getenv("USERPROFILE") or os.getenv("HOME")
if ya.target_family() == "windows" then
  table.insert(bookmarks, {
    tag = "Scoop Local",
    
    path = (os.getenv("SCOOP") or home_path .. "\\scoop") .. "\\",
    key = "p"
  })
  table.insert(bookmarks, {
    tag = "Scoop Global",
    path = (os.getenv("SCOOP_GLOBAL") or "C:\\ProgramData\\scoop") .. "\\",
    key = "P"
  })
end
table.insert(bookmarks, {
  tag = "Desktop",
  path = home_path .. path_sep .. "Desktop" .. path_sep,
  key = "d"
})

require("yamb"):setup {
  -- Optional, the path ending with path seperator represents folder.
  bookmarks = bookmarks,
  -- Optional, the cli of fzf.
  cli = "fzf",
  -- Optional, a string used for randomly generating keys, where the preceding characters have higher priority.
  keys = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
  -- Optional, the path of bookmarks
  path = (ya.target_family() == "windows" and os.getenv("APPDATA") .. "\\yazi\\config\\bookmark") or
        (os.getenv("HOME") .. "/.config/yazi/bookmark"),
}

Add this to your keymap.toml:

[[manager.prepend_keymap]]
on = [ "u", "a" ]
run = "plugin yamb --args=save"
desc = "Add bookmark"

[[manager.prepend_keymap]]
on = [ "u", "g" ]
run = "plugin yamb --args=jump_by_key"
desc = "Jump bookmark by key"

[[manager.prepend_keymap]]
on = [ "u", "G" ]
run = "plugin yamb --args=jump_by_fzf"
desc = "Jump bookmark by fzf"

[[manager.prepend_keymap]]
on = [ "u", "d" ]
run = "plugin yamb --args=delete_by_key"
desc = "Delete bookmark by key"

[[manager.prepend_keymap]]
on = [ "u", "D" ]
run = "plugin yamb --args=delete_by_fzf"
desc = "Delete bookmark by fzf"

[[manager.prepend_keymap]]
on = [ "u", "A" ]
run = "plugin yamb --args=delete_all"
desc = "Delete all bookmarks"

[[manager.prepend_keymap]]
on = [ "u", "r" ]
run = "plugin yamb --args=rename_by_key"
desc = "Rename bookmark by key"

[[manager.prepend_keymap]]
on = [ "u", "R" ]
run = "plugin yamb --args=rename_by_fzf"
desc = "Rename bookmark by fzf"

About

Yet another bookmarks plugins. It supports persistence, jumping by a key, jumping by fzf.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages