Skip to content

Commit 79c75bc

Browse files
committed
clipboard stopped working randomly. Added wsl config to work with xclip
1 parent eb369ed commit 79c75bc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

init.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ vim.opt.showmode = false
111111
-- Remove this option if you want your OS clipboard to remain independent.
112112
-- See `:help 'clipboard'`
113113
vim.opt.clipboard = 'unnamedplus'
114+
vim.g.clipboard = {
115+
name = 'WslClipboard',
116+
copy = {
117+
['+'] = 'clip.exe',
118+
['*'] = 'clip.exe',
119+
},
120+
paste = {
121+
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
122+
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
123+
},
124+
cache_enabled = 0,
125+
}
114126

115127
-- Enable break indent
116128
vim.opt.breakindent = true

0 commit comments

Comments
 (0)