diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index b4a6d5ee..b059deaa 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -55,3 +55,28 @@ if vim.fn.has("nvim-0.10") == 1 then end 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