Using lazy.nvim:
{
"neanvo/buben.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
opts = {}
}
Using packer.nvim:
use {
"neanvo/buben.nvim",
requires = { "nvim-telescope/telescope.nvim" },
config = function()
require("buben").setup()
end
}
The plugin can be configured by passing a table to the setup function. Here's the complete configuration with all available options and their default values:
require("buben").setup({
-- Path where address mappings will be stored
storage_path = vim.fn.stdpath("data") .. "/buben_addresses.json",
-- Popup window configuration for address input/editing
popup = {
-- Width of the input popup window
width = 40,
-- Border style for the popup window
-- Possible values: "none", "single", "double", "rounded", "solid", "shadow"
border = "rounded",
},
-- Enable/disable address concealment
-- When true, the original address will be hidden and only the label will be shown
conceal = true,
-- Symbol used to point to the label
-- Can be any string, including Unicode characters (e.g. "→", "⇒", "▶")
arrow = "→",
-- Enable/disable default highlight groups
-- Set to false if you want to define all highlights manually
use_default_highlights = true,
})
:lua require("buben").add_address()
:lua require("buben").toggle_visibility()
:lua require("buben").open_telescope()
Key | Action |
---|---|
<Enter> |
Copy address to clipboard |
<C-d> |
Delete the selected address |
<C-e> |
Edit name and chain of the selected address |
<Esc> |
Close Telescope window |
vim.keymap.set("n", "<leader>ba", require("buben").add_address, { desc = "Add blockchain address" })
vim.keymap.set("n", "<leader>bt", require("buben").toggle_visibility, { desc = "Toggle address visibility" })
vim.keymap.set("n", "<leader>bl", require("buben").open_telescope, { desc = "List addresses" })
The plugin defines the following highlight groups:
BubenName
: Address nameBubenChain
: Chain identifierBubenSeparator
: Separator elementsBubenTitle
: Popup titleBy default, the plugin sets up these highlight groups with predefined colors. You can:
This is the default behavior, no additional configuration needed.
Override specific highlight groups while keeping others at default:
vim.api.nvim_set_hl(0, "BubenName", { fg = "#98c379", bg = "#565c64" })
vim.api.nvim_set_hl(0, "BubenChain", { fg = "#61afef", bg = "#565c64" })
Disable default highlights in your setup:
require("buben").setup({
use_default_highlights = false
})
Then define your own highlight groups:
-- Define all highlight groups manually
vim.api.nvim_set_hl(0, "BubenName", { fg = "#c678dd", bold = true })
vim.api.nvim_set_hl(0, "BubenChain", { fg = "#98c379", italic = true })
vim.api.nvim_set_hl(0, "BubenSeparator", { fg = "#565c64" })
vim.api.nvim_set_hl(0, "BubenTitle", { fg = "#e5c07b", bold = true })
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
neanvo
If you find this plugin useful, please consider giving it a ⭐️ on GitHub!