···5555## Usage
56565757The 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.
5858-An entry from the menu can also be yanked into the unnamed register by hitting yy.
5858+An entry from the menu can also be yanked into the unnamedplus register by hitting yy.
59596060I would personally also recommend setting a keybind to open the menu.
6161```lua
···6868- Access to other registers (number/letter registers?)
6969- Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option)
70707171+## Alternatives
7272+- [neoclip](https://github.com/AckslD/nvim-neoclip.lua)
7373+- [Yanky](https://github.com/gbprod/yanky.nvim)
+3-6
lua/yankbank/menu.lua
···93939494 -- close window upon selection
9595 vim.api.nvim_win_close(win_id, true)
9696-9797- -- call the custom paste function with adjusted indentation
9898- print(vim.fn.getregtype())
9999- -- vim.api.nvim_paste(text, false, -1)
10096 helpers.smart_paste(text)
10197 else
10298 print("Error: Invalid selection")
···105101106102 -- bind yank behavior to y
107103 vim.keymap.set('n', 'yy', function()
108108- local cursor = vim.api.nvim_win_get_cursor(0)[1]
104104+ local cursor = vim.api.nvim_win_get_cursor(win_id)[1]
109105 local yankIndex = line_yank_map[cursor]
110106 if yankIndex then
111107 local text = yanks[yankIndex]
112112- vim.fn.setreg('"', text)
108108+ -- NOTE: possibly change this to '"' if not using system clipboard
109109+ vim.fn.setreg('+', text)
113110 vim.api.nvim_win_close(win_id, true)
114111 end
115112 end, { buffer = bufnr })