Skip to content

This could be impproved #1

Description

@RoadRoller01

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions