Skip to content

Instantly share code, notes, and snippets.

@jukrb0x
Created March 30, 2024 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jukrb0x/ebeab6ba4503a8f3c7228f4eecc8d04c to your computer and use it in GitHub Desktop.
Save jukrb0x/ebeab6ba4503a8f3c7228f4eecc8d04c to your computer and use it in GitHub Desktop.
neovim-yank-windows-clipboard-sync

create neovim rc file: %USERPROFILE%\AppData\Local\nvim\init.lua

this script enables NeoVim yank synced with either windows or wsl (windows subsystem for linux) clipboard.

vim.opt.clipboard = "unnamedplus"
if vim.fn.has("wsl") == 1 then
vim.g.clipboard = {
name = "win32yank-wsl",
copy = {
["+"] = "win32yank.exe -i --crlf",
["*"] = "win32yank.exe -i --crlf",
},
paste = {
["+"] = "win32yank.exe -o --lf",
["*"] = "win32yank.exe -o --lf",
},
cache_enabled = 0,
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment