gbprod / yanky.nvim

Improved Yank and Put functionalities for Neovim
Do What The F*ck You Want To Public License
802 stars 22 forks source link

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

Closed linrongbin16 closed 8 months ago

linrongbin16 commented 8 months ago

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 8 months ago

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 ;)

linrongbin16 commented 8 months ago

thanks