AckslD / nvim-neoclip.lua

Clipboard manager neovim plugin with telescope integration
996 stars 20 forks source link

don't work with my init.lua #4

Closed doums closed 3 years ago

doums commented 3 years ago

Hi,

I don't know who is the culprit, but when I try to run :Telescope neoclip nothing happen, no telescope window opens.

Here is my init.lua.

I just added

require'neoclip'.setup()

to my init.lua.

Update: It works when I use :lua require('telescope').extensions.neoclip.default(). Maybe there is a problem when the plugin manager is not packer (I use paq).

AckslD commented 3 years ago

Hi @doums!

Hmm strange, I never used paq so not sure how it loads plugins. Does it lazy load?

Does it work if you first do

require('telescope').load_extension('neoclip')

?

stephengolub commented 3 years ago

Piling on for more data on this one. I'm using vim-plug wrapped inside some lua files. It doesn't load there either, I have to do your load_extension example and then it's available (through both the :lua ... and :Telescope ... commands

AckslD commented 3 years ago

Thanks for letting me know @stephengolub! Do you think adding something in the README that in some case one needs to call load_extension is enough? We could also expose another function from neoclip which does that but not sure it gives anything. I would like to avoid calling the load_extension in setup to avoid setting up all of telescope on startup. I'd rather lazy load it when needed. If you have any further thoughts I'm happy to hear them :)

stephengolub commented 3 years ago

Yea, I'd add it to your README. I also use ThePrimeagen/git-worktree.nvim and there's a section in there about integrating it with Telescope.

So maybe add it to your Tips section or create a Troubleshooting section?

doums commented 3 years ago

Hi @AckslD,

I confirm it's work if I load the extension first

require('telescope').load_extension('neoclip')