Skip to content

Instantly share code, notes, and snippets.

@eventualbuddha
Created January 28, 2026 23:28
Show Gist options
  • Select an option

  • Save eventualbuddha/16ce9afb9311b16ba09f4edc79d7c099 to your computer and use it in GitHub Desktop.

Select an option

Save eventualbuddha/16ce9afb9311b16ba09f4edc79d7c099 to your computer and use it in GitHub Desktop.
-- neovim fix for copying within an ssh session (debian 12 vm guest + cosmic terminal host, anyway)
-- put this in ~/.config/nvim/lua/config/autocmds.lua
vim.api.nvim_create_autocmd("TextYankPost", {
group = vim.api.nvim_create_augroup("osc52_yank", { clear = true }),
callback = function()
local text = table.concat(vim.v.event.regcontents, "\n")
local b64 = vim.base64.encode(text)
vim.api.nvim_chan_send(2, string.format("\027]52;c;%s\a", b64))
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment