AckslD / nvim-neoclip.lua

Clipboard manager neovim plugin with telescope integration
931 stars 19 forks source link

Not working in WSL #102

Open hrai opened 1 year ago

hrai commented 1 year ago

When I run the command :Telescope neoclip, I get the error below:

image

I'm on lunarvim on WSL Ubuntu 22.x

My config

{
        "AckslD/nvim-neoclip.lua", --Clipboard manager neovim plugin with telescope integration
        dependencies = {
            { 'kkharji/sqlite.lua',           module = 'sqlite' },
            { 'nvim-telescope/telescope.nvim' },
        },
        after="telescope",
        config = function()
            require('neoclip').setup()
        end,
    }
briskajanis1 commented 1 year ago

Try running :lua require('telescope').load_extension('neoclip') on startup

hrai commented 1 year ago

This works.

But now when I select a new pasted item after I enter :Telescope neoclip, it updates the default register but I'm using WSL so the clipboard setting is different and so the paste p doesn't paste the content of default register "

let g:clipboard = {
  \   'name': 'WslClipboard',
  \   'copy': {
  \      '+': 'clip.exe',
  \      '*': 'clip.exe',
  \    },
  \   'paste': {
  \      '+': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
  \      '*': 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
  \   },
  \   'cache_enabled': 0,
  \ }
AckslD commented 1 year ago

@hrai you can chose which register to populate with :Telescope neoclip <reg>, for example :Telescope neoclip a or :Telescope neoclip plus. You can also directly paste the entry with <C-p> (insert) or p (normal) mode from the picker.