(nvim) use xorg or wayland for clipboard
This commit is contained in:
parent
77dca38f7d
commit
20dd4e841b
1 changed files with 29 additions and 12 deletions
|
|
@ -1,6 +1,22 @@
|
||||||
local Utils = require("juancwu.utils")
|
local Utils = require("juancwu.utils")
|
||||||
|
|
||||||
if Utils.os.is_linux() then
|
if Utils.os.is_linux() then
|
||||||
|
local wayland_display = os.getenv("WAYLAND_DISPLAY")
|
||||||
|
local clipboard_cmd = "xclip"
|
||||||
|
if 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 = {
|
vim.g.clipboard = {
|
||||||
name = "xclip",
|
name = "xclip",
|
||||||
copy = {
|
copy = {
|
||||||
|
|
@ -13,6 +29,7 @@ if Utils.os.is_linux() then
|
||||||
},
|
},
|
||||||
cache_enabled = 1,
|
cache_enabled = 1,
|
||||||
}
|
}
|
||||||
|
end
|
||||||
elseif Utils.os.is_mac() then
|
elseif Utils.os.is_mac() then
|
||||||
vim.opt.clipboard:append { "unnamedplus" }
|
vim.opt.clipboard:append { "unnamedplus" }
|
||||||
elseif Utils.os.is_wsl() then
|
elseif Utils.os.is_wsl() then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue