···11+*yankbank-nvim.txt* For Neovim >= 0.7.0 Last change: 2024 June 11
22+33+==============================================================================
44+Table of Contents *yankbank-nvim-table-of-contents*
55+66+1. YankBank |yankbank-nvim-yankbank|
77+ - What it Does |yankbank-nvim-yankbank-what-it-does|
88+ - Installation and Setup |yankbank-nvim-yankbank-installation-and-setup|
99+ - Usage |yankbank-nvim-yankbank-usage|
1010+ - Potential Improvements |yankbank-nvim-yankbank-potential-improvements|
1111+ - Alternatives |yankbank-nvim-yankbank-alternatives|
1212+2. Links |yankbank-nvim-links|
1313+1414+==============================================================================
1515+1. YankBank *yankbank-nvim-yankbank*
1616+1717+A Neovim plugin for keeping track of more recent yanks and deletions and
1818+exposing them in a quick access menu.
1919+2020+2121+WHAT IT DOES *yankbank-nvim-yankbank-what-it-does*
2222+2323+YankBank stores the N recent yanks into the unnamed register (“), then
2424+populates a popup window with these recent yanks, allowing for quick access to
2525+recent yank history. Upon opening the popup menu, the current contents of the
2626+unnamedplus (+) register are also added to the menu (if they are different than
2727+the current contents of the unnamed register).
2828+2929+Choosing an entry from the menu (by hitting enter) will paste it into the
3030+currently open buffer at the cursor position.
3131+3232+3333+SCREENSHOTS ~
3434+3535+The menu is specific to the current session, and will only contain the contents
3636+of the current unnamedplus register upon opening in a completely new session.
3737+It will be populated further for each yank or deletion in that session.
3838+3939+4040+INSTALLATION AND SETUP *yankbank-nvim-yankbank-installation-and-setup*
4141+4242+Lazy:
4343+4444+>lua
4545+ {
4646+ "ptdewey/yankbank-nvim",
4747+ config = function()
4848+ require('yankbank').setup()
4949+ end,
5050+ }
5151+<
5252+5353+Packer:
5454+5555+>lua
5656+ use {
5757+ 'ptdewey/yankbank-nvim',
5858+ config = function()
5959+ require('yankbank').setup()
6060+ end,
6161+ }
6262+<
6363+6464+6565+SETUP OPTIONS ~
6666+6767+The setup function also supports taking in a table of options: | Option | Type
6868+| Default |
6969+|————-|——————————————–|—————-|
7070+| max_entries | integer number of entries to show in popup | `10` | | sep |
7171+string separator to show between table entries | `"-----"` | | keymaps | table
7272+containing keymap overrides | `{}` | | keymaps.navigation_next | string | `"j"`
7373+| | keymaps.navigation_prev | string | `"k"` | | keymaps.paste | string |
7474+`"<CR>"` | | keymaps.yank | string | `"yy"` | | keymaps.close | table of
7575+strings | `{ "<Esc>", "<C-c>", "q" }` | | num_behavior | string defining jump
7676+behavior "prefix" or "jump" | `"prefix"` | | registers | table container for
7777+register overrides | `{ }` | | registers.yank_register | default register to
7878+yank from popup to | `"+"` |
7979+8080+If no separator is desired, pass in an empty string for sep:
8181+8282+>lua
8383+ config = function()
8484+ require('yankbank').setup({
8585+ max_entries = 12,
8686+ sep = "",
8787+ keymaps = {
8888+ navigation_next = "j",
8989+ navigation_prev = "k",
9090+ },
9191+ num_behavior = "prefix",
9292+ })
9393+ end,
9494+<
9595+9696+The 'num_behavior' option defines in-popup navigation behavior when hitting
9797+number keys. - `num_behavior = "prefix"` works similar to traditional vim
9898+navigation with '3j' moving down 3 entries in the bank. - `num_behavior =
9999+"jump"` jumps to entry matching the pressed number key (i.e. '3' jumps to
100100+entry 3) - Note: If 'max_entries' is a two-digit number, there will be a delay
101101+upon pressing numbers that prefix a valid entry.
102102+103103+104104+USAGE *yankbank-nvim-yankbank-usage*
105105+106106+The popup menu can be opened with the command:`:YankBank`, an entry is pasted
107107+at the current cursor position by hitting enter, and the menu can be closed by
108108+hitting escape, ctrl-c, or q. An entry from the menu can also be yanked into
109109+the unnamedplus register by hitting yy.
110110+111111+I would personally also recommend setting a keybind to open the menu.
112112+113113+>lua
114114+ -- map to '<leader>y'
115115+ vim.keymap.set("n", "<leader>y", "<cmd>YankBank<CR>", { noremap = true })
116116+<
117117+118118+119119+POTENTIAL IMPROVEMENTS *yankbank-nvim-yankbank-potential-improvements*
120120+121121+- Persistence between sessions (through either sqlite database or just a file)
122122+- Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option)
123123+- nvim-cmp integration
124124+- fzf integration
125125+- Setup options configuring which registers are included
126126+127127+128128+ALTERNATIVES *yankbank-nvim-yankbank-alternatives*
129129+130130+- nvim-neoclip <https://github.com/AckslD/nvim-neoclip.lua>
131131+- yanky.nvim <https://github.com/gbprod/yanky.nvim>
132132+133133+==============================================================================
134134+2. Links *yankbank-nvim-links*
135135+136136+1. *YankBank popup window*: assets/screenshot-1.png
137137+2. *YankBank popup window zoomed*: assets/screenshot-2.png
138138+139139+Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
140140+141141+vim:tw=78:ts=8:noet:ft=help:norl: