Skip to content

Commit

Permalink
recipes: add clipboard in wsl without xclip
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Mar 31, 2024
1 parent f2ab087 commit 1724ab5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/routes/docs/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
```

0 comments on commit 1724ab5

Please sign in to comment.