···11# YankBank
22+23A Neovim plugin for keeping track of more recent yanks and deletions and exposing them in a quick access menu.
3445## What it Does
66+57YankBank stores the N recent yanks into the unnamed register ("), then populates a popup window with these recent yanks, allowing for quick access to recent yank history.
68Upon opening the popup menu, the current contents of the unnamedplus (+) register are also added to the menu (if they are different than the current contents of the unnamed register).
79810Choosing an entry from the menu (by hitting enter) will paste it into the currently open buffer at the cursor position.
9111010-Popup window:
1212+### Screenshots
1313+1114
1515+1616+
12171318The menu is specific to the current session, and will only contain the contents of the current unnamedplus register upon opening in a completely new session.
1419It will be populated further for each yank or deletion in that session.
···3540}
3641```
37424343+### Setup Options
4444+3845The setup function also supports taking in a table of options:
3946| Option | Type | Default |
4047|-------------|--------------------------------------------|----------------|
···6976- `num_behavior = "jump"` jumps to entry matching the pressed number key (i.e. '3' jumps to entry 3)
7077 - Note: If 'max_entries' is a two-digit number, there will be a delay upon pressing numbers that prefix a valid entry.
71787979+7280## Usage
73817482The popup menu can be opened with the command:`:YankBank`, an entry is pasted at the current cursor position by hitting enter, and the menu can be closed by hitting escape, ctrl-c, or q.
···7987-- map to '<leader>y'
8088vim.keymap.set("n", "<leader>y", "<cmd>YankBank<CR>", { noremap = true })
8189```
9090+82918392## Potential Improvements
9393+8494- Persistence between sessions (through either sqlite database or just a file)
8595- Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option)
8696- nvim-cmp integration
···8898- Setup options configuring which registers are included
899990100## Alternatives
101101+91102- [nvim-neoclip](https://github.com/AckslD/nvim-neoclip.lua)
92103- [yanky.nvim](https://github.com/gbprod/yanky.nvim)