Closed yofriadi closed 1 year ago
What is WSL?
We are not familiar with Windows Subsystem for Linux and since I don't have a Windows machine it would be hard to support without testing. Although, it may be easy by adding a new switch case statement like we're doing in below for macOS. The questions are what we are going to get from $OSTYPE
and how are we going to get and set clipboard content via command-line.
hmm I do this on my vim config, even though I don't know what it is, will this help maybe
" WSL yank support
let s:clip = '/mnt/c/Windows/System32/clip.exe'
if executable(s:clip)
augroup WSLYank
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
augroup END
endif
OSTYPE
parameter should be linux- in WSL, should be able to match it on the existing linux glob and then check for WSL specific commands after—e.g. win32yank(.exe), clip(.exe), pwsh.exe.
As a temporary solution for WSL users—here's an xclip command replacement that operates on the Windows clipboard, it should be handled by the xclip case transparently based on the xclip detection code above.
I notice that this plugin does not work on my WSL specifically WSL 2 but work in my macbook. Thankyou if you would provide this support.