update bashrc.arch and nvim

This commit is contained in:
juancwu 2025-07-30 22:52:24 -04:00
commit 78115fb3e0
No known key found for this signature in database
7 changed files with 94 additions and 135 deletions

View file

@ -1,59 +1,58 @@
local Utils = require("juancwu.utils")
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 = {
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
local wayland_display = os.getenv("WAYLAND_DISPLAY")
if Utils.os.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 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 Utils.os.is_mac() then
vim.g.clipboard = {
name = "mac-clipboard",
copy = {
['+'] = "pbcopy",
['*'] = "pbcopy",
},
paste = {
['+'] = "pbpaste",
['*'] = "pbpaste",
},
cache_enabled = 1,
}
elseif Utils.os.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,
}
vim.g.clipboard = {
name = "mac-clipboard",
copy = {
["+"] = "pbcopy",
["*"] = "pbcopy",
},
paste = {
["+"] = "pbpaste",
["*"] = "pbpaste",
},
cache_enabled = 1,
}
end