diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-12-29 13:53:46 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-12-29 13:53:46 +0530 |
commit | 5b62a6fdcaf0604d1234a89d0629680ca77317a5 (patch) | |
tree | 8c767ded3caf88aeac872ddd3f593e00abe91a2d /plugin | |
parent | 3150e42b2b3c2e9ea7da1d8ea0d06243d0d56d2a (diff) |
moving clipboard setting to separate file in plugin folder
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/clipboard.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugin/clipboard.lua b/plugin/clipboard.lua new file mode 100644 index 0000000..853939e --- /dev/null +++ b/plugin/clipboard.lua @@ -0,0 +1,22 @@ +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 + + vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy "+", + ["*"] = require("vim.ui.clipboard.osc52").copy "*", + }, + paste = { + ["+"] = vim_paste, + ["*"] = vim_paste, + }, + } +end |