[mini.pick] How to paste from system clipboard in SSH #1263
Replies: 3 comments 6 replies
-
Is there a way you can paste what you want in regular buffer? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
This is indead a rather annoying thing to deal with. I guess this is because the search buffer is catching keystrokes via For now I will try the solution below, as I'm also dealing with this. The snippet might be an example of overriding the Please note, do this after calling setup! local paste_orig = vim.paste
---@diagnostic disable-next-line: duplicate-set-field
vim.paste = function (...)
if not MiniPick.is_picker_active() then
return paste_orig(...)
end
-- Encountered inconsistent register values after copying from host machine
-- Could add more, please check `Pick registers` on strategic times to inspect state
for _, reg in ipairs({ '+', '.', '*' }) do
local content = vim.fn.getreg(reg) or ''
if content ~= '' then
MiniPick.set_picker_query({ content })
return
end
end
-- Yes, I know about <C-r>, will suppress that message, but show \something\ for feedback reasons
vim.notify('No content to paste', vim.log.levels.WARN)
end |
Beta Was this translation helpful? Give feedback.
-
I use my remote machine over SSH and
<C-r>+
does not paste from HOST's clipboard, it pastes from remote machines clipboard.Beta Was this translation helpful? Give feedback.
All reactions