fix(nvim): wsl clipboard

This commit is contained in:
Sergio Laín 2025-07-16 21:12:27 +02:00
parent c8b09f19d7
commit 3d74562317
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438

View file

@ -55,3 +55,28 @@ if vim.fn.has("nvim-0.10") == 1 then
end end
o.conceallevel = 2 o.conceallevel = 2
-- Use the right clipboard when on WSL
local function is_wsl()
local wsl_check = os.getenv("WSL_DISTRO_NAME") ~= nil
return wsl_check
end
-- Install win32yank with cargo and then run:
-- sudo ln -s /mnt/c/Users/jared/.cargo/bin/win32yank.exe /usr/local/bin/win32yank
if is_wsl() then
go.clipboard = {
name = "win32yank-wsl",
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
cache_enabled = 1,
}
end