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

Configure Feed

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

refactor(fixed setup order in init.lua)

+8 -7
+8 -7
lua/yankbank/init.lua
··· 10 10 local yanks = {} 11 11 local reg_types = {} 12 12 13 + YANKS = {} 14 + REG_TYPES = {} 15 + 13 16 local plugin_path = debug.getinfo(1).source:sub(2):match("(.*/).*/.*/") or "./" 14 17 15 18 -- default plugin options ··· 23 26 -- wrapper function for main plugin functionality 24 27 ---@param opts table 25 28 local function show_yank_bank(opts) 26 - -- Parse command arguments directly if args are provided as a string 27 - 29 + -- create and fill buffer 28 30 local bufnr, display_lines, line_yank_map = 29 31 menu.create_and_fill_buffer(yanks, reg_types, opts) 30 32 ··· 43 45 -- merge opts with default options table 44 46 opts = vim.tbl_deep_extend("force", default_opts, opts or {}) 45 47 48 + -- enable persistence based on opts 49 + -- (needs to be called before autocmd setup) 50 + persistence.setup(yanks, reg_types, opts) 51 + 46 52 -- create clipboard autocmds 47 53 clipboard.setup_yank_autocmd(yanks, reg_types, opts) 48 - 49 - -- enable persistence based on opts 50 - yanks, reg_types = persistence.setup(yanks, reg_types, opts) 51 - -- print(vim.inspect(yanks)) 52 - -- print(vim.inspect(reg_types)) 53 54 54 55 -- Create user command 55 56 vim.api.nvim_create_user_command("YankBank", function()