(nvim) nvim v0.12 migration
This commit is contained in:
parent
f0db0ada98
commit
7b2eb8c525
51 changed files with 1629 additions and 1627 deletions
73
nvim/lua/clipboard.lua
Normal file
73
nvim/lua/clipboard.lua
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
local os_utils = require("os_utils")
|
||||
|
||||
if os_utils.is_linux() then
|
||||
local wayland_display = os.getenv("WAYLAND_DISPLAY")
|
||||
local ssh_tty = os.getenv("SSH_TTY")
|
||||
if os_utils.is_wsl() then
|
||||
vim.g.clipboard = {
|
||||
name = "win32yank",
|
||||
copy = {
|
||||
["+"] = "win32yank.exe -i --crlf",
|
||||
["*"] = "win32yank.exe -i --crlf",
|
||||
},
|
||||
paste = {
|
||||
["+"] = "win32yank.exe -o --lf",
|
||||
["*"] = "win32yank.exe -o --lf",
|
||||
},
|
||||
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",
|
||||
copy = {
|
||||
["+"] = "wl-copy",
|
||||
["*"] = "wl-copy",
|
||||
},
|
||||
paste = {
|
||||
["+"] = "wl-paste",
|
||||
["*"] = "wl-paste",
|
||||
},
|
||||
cache_enabled = 1,
|
||||
}
|
||||
else
|
||||
vim.g.clipboard = {
|
||||
name = "xclip",
|
||||
copy = {
|
||||
["+"] = "xclip -sel clip -i -quiet",
|
||||
["*"] = "xclip -sel primary -i -quiet",
|
||||
},
|
||||
paste = {
|
||||
["+"] = "xclip -sel clip -o -quiet",
|
||||
["*"] = "xclip -sel primary -o -quiet",
|
||||
},
|
||||
cache_enabled = 1,
|
||||
}
|
||||
end
|
||||
elseif os_utils.is_mac() then
|
||||
vim.g.clipboard = {
|
||||
name = "mac-clipboard",
|
||||
copy = {
|
||||
["+"] = "pbcopy",
|
||||
["*"] = "pbcopy",
|
||||
},
|
||||
paste = {
|
||||
["+"] = "pbpaste",
|
||||
["*"] = "pbpaste",
|
||||
},
|
||||
cache_enabled = 1,
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue