AckslD / nvim-neoclip.lua

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

neoclip not working #107

Closed RiteshChepuri closed 5 months ago

RiteshChepuri commented 7 months ago

the yanked text shows in the neoclip telescope extension but when I select the text to copy. the selected text doesn't loaded into paste buffer. my Neoclip config file

require('neoclip').setup({
    history = 1000,
      enable_persistent_history = false,
      length_limit = 1048576,
      continuous_sync = false,
      db_path = vim.fn.stdpath("data") .. "/databases/neoclip.sqlite3",
      filter = nil,
      preview = true,
      prompt = nil,
      default_register = '"',
      default_register_macros = 'q',
      enable_macro_history = true,
      content_spec_column = false,
      disable_keycodes_parsing = false,
      on_select = {
        move_to_front = false,
        close_telescope = true,
      },
      on_paste = {
        set_reg = false,
        move_to_front = false,
        close_telescope = true,
      },
      on_replay = {
        set_reg = false,
        move_to_front = false,
        close_telescope = true,
      },
      on_custom_action = {
        close_telescope = true,
      },
      keys = {
        telescope = {
          i = {
            select = '<cr>',
            paste = '<c-j>',
            paste_behind = '<c-k>',
            replay = '<c-q>',  -- replay a macro
            delete = '<c-d>',  -- delete an entry
            edit = '<c-e>',  -- edit an entry
            custom = {},
          },
          n = {
            select = '<CR>',
            paste = 'p',
            --- It is possible to map to more than one key.
            -- paste = { 'p', '<c-p>' },
            paste_behind = 'P',
            replay = 'q',
            delete = 'd',
            edit = 'e',
            custom = {},
          },
        },
      },
})

vim.keymap.set("n",  "<leader>o", "<cmd>Telescope neoclip<CR>", { desc = "Telescope Neoclip"})
return {
    "AckslD/nvim-neoclip.lua",
    dependencies = {
      { "nvim-telescope/telescope.nvim" },
    },
    config = function()
      require("configs.neoclip")
    end,
  }
AckslD commented 7 months ago

@RiteshChepuri can you provide some more details? What's your :registers after selecting the entry? And you does eg <c-p> or p work?

RiteshChepuri commented 7 months ago

before selecting desired text image

after selecting from neoclip image

but when I try to paste nothing in register being prompted

AckslD commented 7 months ago

@RiteshChepuri I don't know what you're copying. The default register (") did change

AckslD commented 7 months ago

Are you pasting with p?

RiteshChepuri commented 7 months ago

Yeah it's p in normal mode right!

RiteshChepuri commented 7 months ago

Yeah the default register is changing but when I try to paste it's not pasting the default one I guess

AckslD commented 7 months ago

Do you have any remaps of p? What's :nmap p?

RiteshChepuri commented 7 months ago

No mapping found

AckslD commented 7 months ago

Does "p paste the correct thing?

RiteshChepuri commented 7 months ago

Yeah it pastes the last copied one.

AckslD commented 7 months ago

So not the one you see in :registers?

AckslD commented 7 months ago

Just to be clear, could you clarify exactly:

cabra-arretado commented 7 months ago

My one was also not working. What is the clipboard your Neovim is configured? My one is unnamedplus. To make the plugin work I just changed the default register for Neoclip to +. So just figure out what is the clipboard that your Neovim is configured and change it in the Neoclip setup :D

local neoclip = require("neoclip")

neoclip.setup({
  default_register = '+',
})
RiteshChepuri commented 5 months ago

yeah i used to use vim.opt.clipboard= "" it used to work fine within neovim and neoclip but the system clipboard isn't working wheni change my vim.opt.clipboard:append("unanamedplus") the system clipboard is working but neoclip isnt working . what might be the reason ? what is the fix?

AckslD commented 5 months ago

I'm not sure what you mean with "not working", indeed if you run Telescope neoclip with the default configuration and select an entry it will write this to the "" register. If you're pasting from a different register than "" after that (by for example changing :set clipboard), then indeed you won't get what you previously selected.

If you want to update some other register with Telescope neoclip you can indeed change the default register as @cabra-arretado mentions or run Telescope neoclip plus or similar.