(nvim) file clipboard
This commit is contained in:
parent
2925f73722
commit
cc4bd1c907
1 changed files with 15 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ local Utils = require("juancwu.utils")
|
|||
|
||||
if Utils.os.is_linux() then
|
||||
local wayland_display = os.getenv("WAYLAND_DISPLAY")
|
||||
local ssh_tty = os.getenv("SSH_TTY")
|
||||
if Utils.os.is_wsl() then
|
||||
vim.g.clipboard = {
|
||||
name = "win32yank",
|
||||
|
|
@ -15,6 +16,20 @@ if Utils.os.is_linux() then
|
|||
},
|
||||
cache_enabled = 0,
|
||||
}
|
||||
elseif ssh_tty then
|
||||
local clip_path = vim.fn.expand("~/.clipboard")
|
||||
vim.g.clipboard = {
|
||||
name = "file-clipboard",
|
||||
copy = {
|
||||
["+"] = { "tee", clip_path },
|
||||
["*"] = { "tee", clip_path },
|
||||
},
|
||||
paste = {
|
||||
["+"] = { "cat", clip_path },
|
||||
["*"] = { "cat", clip_path },
|
||||
},
|
||||
cache_enabled = 1,
|
||||
}
|
||||
elseif wayland_display then
|
||||
vim.g.clipboard = {
|
||||
name = "wl-clipboard",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue