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

Configure Feed

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

auto-generate vimdoc

+141
+141
doc/yankbank-nvim.txt
··· 1 + *yankbank-nvim.txt* For Neovim >= 0.7.0 Last change: 2024 June 11 2 + 3 + ============================================================================== 4 + Table of Contents *yankbank-nvim-table-of-contents* 5 + 6 + 1. YankBank |yankbank-nvim-yankbank| 7 + - What it Does |yankbank-nvim-yankbank-what-it-does| 8 + - Installation and Setup |yankbank-nvim-yankbank-installation-and-setup| 9 + - Usage |yankbank-nvim-yankbank-usage| 10 + - Potential Improvements |yankbank-nvim-yankbank-potential-improvements| 11 + - Alternatives |yankbank-nvim-yankbank-alternatives| 12 + 2. Links |yankbank-nvim-links| 13 + 14 + ============================================================================== 15 + 1. YankBank *yankbank-nvim-yankbank* 16 + 17 + A Neovim plugin for keeping track of more recent yanks and deletions and 18 + exposing them in a quick access menu. 19 + 20 + 21 + WHAT IT DOES *yankbank-nvim-yankbank-what-it-does* 22 + 23 + YankBank stores the N recent yanks into the unnamed register (“), then 24 + populates a popup window with these recent yanks, allowing for quick access to 25 + recent yank history. Upon opening the popup menu, the current contents of the 26 + unnamedplus (+) register are also added to the menu (if they are different than 27 + the current contents of the unnamed register). 28 + 29 + Choosing an entry from the menu (by hitting enter) will paste it into the 30 + currently open buffer at the cursor position. 31 + 32 + 33 + SCREENSHOTS ~ 34 + 35 + The menu is specific to the current session, and will only contain the contents 36 + of the current unnamedplus register upon opening in a completely new session. 37 + It will be populated further for each yank or deletion in that session. 38 + 39 + 40 + INSTALLATION AND SETUP *yankbank-nvim-yankbank-installation-and-setup* 41 + 42 + Lazy: 43 + 44 + >lua 45 + { 46 + "ptdewey/yankbank-nvim", 47 + config = function() 48 + require('yankbank').setup() 49 + end, 50 + } 51 + < 52 + 53 + Packer: 54 + 55 + >lua 56 + use { 57 + 'ptdewey/yankbank-nvim', 58 + config = function() 59 + require('yankbank').setup() 60 + end, 61 + } 62 + < 63 + 64 + 65 + SETUP OPTIONS ~ 66 + 67 + The setup function also supports taking in a table of options: | Option | Type 68 + | Default | 69 + |————-|——————————————–|—————-| 70 + | max_entries | integer number of entries to show in popup | `10` | | sep | 71 + string separator to show between table entries | `"-----"` | | keymaps | table 72 + containing keymap overrides | `{}` | | keymaps.navigation_next | string | `"j"` 73 + | | keymaps.navigation_prev | string | `"k"` | | keymaps.paste | string | 74 + `"<CR>"` | | keymaps.yank | string | `"yy"` | | keymaps.close | table of 75 + strings | `{ "<Esc>", "<C-c>", "q" }` | | num_behavior | string defining jump 76 + behavior "prefix" or "jump" | `"prefix"` | | registers | table container for 77 + register overrides | `{ }` | | registers.yank_register | default register to 78 + yank from popup to | `"+"` | 79 + 80 + If no separator is desired, pass in an empty string for sep: 81 + 82 + >lua 83 + config = function() 84 + require('yankbank').setup({ 85 + max_entries = 12, 86 + sep = "", 87 + keymaps = { 88 + navigation_next = "j", 89 + navigation_prev = "k", 90 + }, 91 + num_behavior = "prefix", 92 + }) 93 + end, 94 + < 95 + 96 + The 'num_behavior' option defines in-popup navigation behavior when hitting 97 + number keys. - `num_behavior = "prefix"` works similar to traditional vim 98 + navigation with '3j' moving down 3 entries in the bank. - `num_behavior = 99 + "jump"` jumps to entry matching the pressed number key (i.e. '3' jumps to 100 + entry 3) - Note: If 'max_entries' is a two-digit number, there will be a delay 101 + upon pressing numbers that prefix a valid entry. 102 + 103 + 104 + USAGE *yankbank-nvim-yankbank-usage* 105 + 106 + The popup menu can be opened with the command:`:YankBank`, an entry is pasted 107 + at the current cursor position by hitting enter, and the menu can be closed by 108 + hitting escape, ctrl-c, or q. An entry from the menu can also be yanked into 109 + the unnamedplus register by hitting yy. 110 + 111 + I would personally also recommend setting a keybind to open the menu. 112 + 113 + >lua 114 + -- map to '<leader>y' 115 + vim.keymap.set("n", "<leader>y", "<cmd>YankBank<CR>", { noremap = true }) 116 + < 117 + 118 + 119 + POTENTIAL IMPROVEMENTS *yankbank-nvim-yankbank-potential-improvements* 120 + 121 + - Persistence between sessions (through either sqlite database or just a file) 122 + - Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option) 123 + - nvim-cmp integration 124 + - fzf integration 125 + - Setup options configuring which registers are included 126 + 127 + 128 + ALTERNATIVES *yankbank-nvim-yankbank-alternatives* 129 + 130 + - nvim-neoclip <https://github.com/AckslD/nvim-neoclip.lua> 131 + - yanky.nvim <https://github.com/gbprod/yanky.nvim> 132 + 133 + ============================================================================== 134 + 2. Links *yankbank-nvim-links* 135 + 136 + 1. *YankBank popup window*: assets/screenshot-1.png 137 + 2. *YankBank popup window zoomed*: assets/screenshot-2.png 138 + 139 + Generated by panvimdoc <https://github.com/kdheepak/panvimdoc> 140 + 141 + vim:tw=78:ts=8:noet:ft=help:norl: