• Marc Cornellà's avatar
    lib: support additional clipboard types (#7996) · 65642dfc
    Marc Cornellà authored
    * clipboard: Reduce unnecessary special-casing on stdin
    
    Ideally the parameter would just be removed-users could always
    just do "clipcopy < some-file". but removing the parameter would break
    backwards compatibility.
    
    In any case, this simplifies the logic considerably.
    
    * clipboard: Avoid unnecessary re-detection each time
    
    Previously, OS detection would happen on each invocation. This makes it
    happen once (unless it fails, in which case it will try again on the
    next invocation).
    
    This has the additional benefit of localizing the platform-specific
    checks and commands, too, versus spreading them out in separate
    functions.
    
    * clipboard: Add support for several more clipboards
    
    This implements essentially the same heuristic as neovim, with the additional
    (existing) special support for Cygwin.
    See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121
      - pbcopy, pbpaste (macOS)
      - cygwin (Windows running Cygwin)
      - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
      - xclip (if $DISPLAY is set)
      - xsel (if $DISPLAY is set)
      - lemonade (for SSH) https://github.com/pocke/lemonade
      - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
      - win32yank (Windows)
      - tmux (if $TMUX is set)
    
    * clipboard: Fix tmux clipcopy after testing
    
    Tmux must have special handling for /dev/stdin since it's managing the
    terminal itself. This was tested with tmux-2.9a on macOS.
    
    * clipboard: Fix bad expansion of exit-code test
    65642dfc
Name
Last commit
Last update
.github Loading commit data...
cache Loading commit data...
custom Loading commit data...
lib Loading commit data...
log Loading commit data...
plugins Loading commit data...
templates Loading commit data...
themes Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.gitignore Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE.txt Loading commit data...
README.md Loading commit data...
oh-my-zsh.sh Loading commit data...