Add osc-52 to copy/paste to support yank over ssh

This commit is contained in:
2025-12-06 18:38:41 +09:00
parent c3dd5604dd
commit 504664293c

View File

@@ -3,7 +3,7 @@
-- Add any additional options here -- Add any additional options here
local is_windows = vim.fn.has("win32") == 1 local is_windows = vim.fn.has("win32") == 1
local is_linux = vim.fn.has("unix") == 1 and not is_windows local is_linux = vim.fn.has("unix") == 1 and not is_windows
if is_windows then if is_windows then
vim.opt.shell = "pwsh" vim.opt.shell = "pwsh"
@@ -24,14 +24,22 @@ vim.g.autoformat = false
-- Sync clipboard between OS and Neovim. -- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function() vim.schedule(function()
vim.opt.clipboard = "unnamedplus" vim.opt.clipboard = "unnamedplus"
vim.g.clipboard = {
name = "OSC 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
},
}
end) end)
-- colorscheme settings -- colorscheme settings
vim.g.nord_contrast = false vim.g.nord_contrast = false