dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

This could be impproved

Open RoadRoller01 opened this issue 10 months ago • 0 comments

https://github.com/ecly/dotfiles/blob/54845ff900988dbcd5cf25c7cb597bbe776eef0d/.vim/lua/core/options.lua#L69C1-L88C3 instead of checking if you are running on wsl, you may check if win32yank.exe exists like this:

vim.cmd [[
    let windows = executable('win32yank.exe')
    if windows
          let 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,
                \ }
    endif
]]

The only disadvantage of this is that if you are using WSL and have not installed Win32yank, you will not receive any error messages, unlike with your current implementation.

RoadRoller01 avatar Feb 18 '25 12:02 RoadRoller01