···20202121## Installation and Setup
22222323-#### Without persistence:
2323+#### With Persistence (Recommended)
24242525-Lazy:
2525+Using lazy.nvim
2626```lua
2727{
2828 "ptdewey/yankbank-nvim",
2929+ dependencies = "kkharji/sqlite.lua",
2930 config = function()
3030- require('yankbank').setup()
3131+ require('yankbank').setup({
3232+ persist_type = "sqlite",
3333+ })
3134 end,
3235}
3336```
34373535-#### With Persistence
3838+#### Without persistence:
36393737-Lazy:
4040+Using lazy.nvim
3841```lua
3942{
4043 "ptdewey/yankbank-nvim",
4141- dependencies = "kkharji/sqlite.lua",
4244 config = function()
4343- require('yankbank').setup({
4444- persist_type = "sqlite",
4545- })
4545+ require('yankbank').setup()
4646 end,
4747}
4848```
···7070#### Example Configuration
71717272```lua
7373-config = function()
7474- require('yankbank').setup({
7575- max_entries = 9,
7676- sep = "",
7777- num_behavior = "prefix",
7878- focus_gain_poll = true,
7979- keymaps = {
8080- paste = "<CR>",
8181- },
8282- num_behavior = "prefix",
8383- persist_type = "sqlite",
8484- registers = {
8585- yank_register = "+",
8686- },
8787- })
8888-end,
7373+{
7474+ "ptdewey/yankbank-nvim",
7575+ config = function()
7676+ require('yankbank').setup({
7777+ max_entries = 9,
7878+ sep = "-----",
7979+ num_behavior = "jump",
8080+ focus_gain_poll = true,
8181+ persist_type = "sqlite",
8282+ keymaps = {
8383+ paste = "<CR>",
8484+ },
8585+ registers = {
8686+ yank_register = "+",
8787+ },
8888+ })
8989+ end,
9090+}
8991```
90929193If no separator is desired, pass in an empty string for `sep`
···9597- `num_behavior = "jump"` jumps to entry matching the pressed number key (i.e. '3' jumps to entry 3)
9698 - Note: If 'max_entries' is a two-digit number, there will be a delay upon pressing numbers that prefix a valid entry.
9799100100+The 'focus_gain_poll' option allows for enabling an additional autocommand that watches for focus gains (refocusing Neovim window), and checks for changes in the unnamedplus ('+') register, adding to yankbank when new contents are found. This allows for automatically adding text copied from other sources (like a browser) to the yankbank without the bank opening trigger. Off by default, but I highly recommend enabling it with `focus_gain_poll = true`.
101101+98102### Persistence
9999-If persistence between sessions is desired, sqlite.lua will be used to create a persistent store for recent yanks in the plugin root directory.
103103+For the best experience with YankBank, enabling persistence is highly recommended.
104104+If persistence is enabled, sqlite.lua will be used to create a persistent store for recent yanks in the plugin root directory.
100105To utilize sqlite persistence, `"kkharji/sqlite.lua"` must be added as a dependency in your config, and `persist_type` must be set to `"sqlite"`:
101106102107```lua
···113118}
114119```
115120116116-The 'focus_gain_poll' option allows for enabling an additional autocommand that watches for focus gains (refocusing Neovim window), and checks for changes in the unnamedplus ('+') register, adding to yankbank when new contents are found. This allows for automatically adding text copied from other sources (like a browser) to the yankbank without the bank opening trigger. Off by default, but I highly recommend enabling it (`focus_gain_poll = true`)
117121118122## Usage
119123···128132129133130134## Potential Improvements
131131-- Polling on unnamedplus register to populate bank in more intuitive manner (could be enabled as option)
132135- nvim-cmp integration
133136- fzf integration
134137- telescope integration