Neovim plugin improving access to clipboard history (mirror)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(fixed yank behavior not fetching from correct window id)

+7 -7
+4 -1
README.md
··· 55 55 ## Usage 56 56 57 57 The 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. 58 - An entry from the menu can also be yanked into the unnamed register by hitting yy. 58 + An entry from the menu can also be yanked into the unnamedplus register by hitting yy. 59 59 60 60 I would personally also recommend setting a keybind to open the menu. 61 61 ```lua ··· 68 68 - Access to other registers (number/letter registers?) 69 69 - Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option) 70 70 71 + ## Alternatives 72 + - [neoclip](https://github.com/AckslD/nvim-neoclip.lua) 73 + - [Yanky](https://github.com/gbprod/yanky.nvim)
+3 -6
lua/yankbank/menu.lua
··· 93 93 94 94 -- close window upon selection 95 95 vim.api.nvim_win_close(win_id, true) 96 - 97 - -- call the custom paste function with adjusted indentation 98 - print(vim.fn.getregtype()) 99 - -- vim.api.nvim_paste(text, false, -1) 100 96 helpers.smart_paste(text) 101 97 else 102 98 print("Error: Invalid selection") ··· 105 101 106 102 -- bind yank behavior to y 107 103 vim.keymap.set('n', 'yy', function() 108 - local cursor = vim.api.nvim_win_get_cursor(0)[1] 104 + local cursor = vim.api.nvim_win_get_cursor(win_id)[1] 109 105 local yankIndex = line_yank_map[cursor] 110 106 if yankIndex then 111 107 local text = yanks[yankIndex] 112 - vim.fn.setreg('"', text) 108 + -- NOTE: possibly change this to '"' if not using system clipboard 109 + vim.fn.setreg('+', text) 113 110 vim.api.nvim_win_close(win_id, true) 114 111 end 115 112 end, { buffer = bufnr })