diff --git a/src/routes/docs/recipes.mdx b/src/routes/docs/recipes.mdx index 45458cc6..71a5a9c0 100644 --- a/src/routes/docs/recipes.mdx +++ b/src/routes/docs/recipes.mdx @@ -80,3 +80,23 @@ autocmd("BufReadPost", { end, }) ``` + +## Clipboard in WSL without xclip + +- This is a WSL specific setting to use the Windows clipboard for + and * registers +- If you have the default PowerShell, substitute pwsh.exe with powershell.exe + +```lua +vim.g.clipboard = { + name = 'WslClipboard', + copy = { + ['+'] = 'clip.exe', + ['*'] = 'clip.exe', + }, + paste = { + ['+'] = 'pwsh.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', + ['*'] = 'pwsh.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', + }, + cache_enabled = 0, +} +```