diff options
| author | Brahmajit Das <listout@listout.xyz> | 2026-02-15 03:42:31 +0000 |
|---|---|---|
| committer | Brahmajit Das <listout@listout.xyz> | 2026-02-15 03:42:31 +0000 |
| commit | d5cb6142b62b2aedf3eea78397bb3ef56813aff5 (patch) | |
| tree | 46f115b9ec5157c2bbe4f4c0afe0dce4e821969e | |
| parent | f1b3356689003abe9edb5a46d4a091b0a41d7306 (diff) | |
| download | nvim-d5cb6142b62b2aedf3eea78397bb3ef56813aff5.tar.gz | |
Signed-off-by: Brahmajit Das <listout@listout.xyz>
| -rw-r--r-- | plugin/clipboard.lua | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/plugin/clipboard.lua b/plugin/clipboard.lua index 853939e..b81b6c9 100644 --- a/plugin/clipboard.lua +++ b/plugin/clipboard.lua @@ -1,22 +1,17 @@ -local opt = vim.opt - -opt.clipboard = "unnamedplus" - if vim.env.SSH_CONNECTION then - local function vim_paste() - local content = vim.fn.getreg '"' - return vim.split(content, "\n") - end + local osc52 = require("vim.ui.clipboard.osc52") vim.g.clipboard = { - name = "OSC 52", + name = "osc52", copy = { - ["+"] = require("vim.ui.clipboard.osc52").copy "+", - ["*"] = require("vim.ui.clipboard.osc52").copy "*", + ["+"] = osc52.copy("+"), + ["*"] = osc52.copy("*"), }, paste = { - ["+"] = vim_paste, - ["*"] = vim_paste, + ["+"] = osc52.paste("+"), + ["*"] = osc52.paste("*"), }, } +else + vim.opt.clipboard = "unnamedplus" end |
