gbprod/yanky.nvim

Question: is there lua API to get last yank/copy text, and get all the yank/copy history?

Closed this issue · 2 comments

Hi,

I'm writing a fzf-based plugin fzfx.nvim, and I want to get the yank/copy text (and in the future I even want the yank/copy buffer filename & lineno info etc) from yanky.nvim, so I don't have to implement the yank relate logic again.

Is there lua API to get the latest yank/copy test? And get all the yank/copy history?

gbprod commented

Yes, you can look try with require("yanky.history").all() and look at the history api. This will returns a collection of objects with regcontents, regtype and filetype.

You can also look at the telescope plugin for inspiration ;)

thanks