Skip to content

Commit

Permalink
feat(clipboard): try cygutils, clip on Windows neovim#30215
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu authored Sep 2, 2024
1 parent a8fc799 commit 60ea046
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions runtime/autoload/provider/clipboard.vim
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ function! provider#clipboard#Executable() abort
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'win32yank'
elseif executable('putclip') && executable('getclip')
let s:copy['+'] = ['putclip']
let s:paste['+'] = ['getclip']
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'putclip'
elseif executable('clip') && executable('powershell')
let s:copy['+'] = ['clip']
let s:paste['+'] = ['powershell', '-NoProfile', '-NoLogo', '-Command', 'Get-Clipboard']
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'clip'
elseif executable('termux-clipboard-set')
let s:copy['+'] = ['termux-clipboard-set']
let s:paste['+'] = ['termux-clipboard-get']
Expand Down
2 changes: 2 additions & 0 deletions runtime/doc/provider.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ registers. Nvim looks for these clipboard tools, in order of priority:
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
- win32yank (Windows)
- putclip, getclip (Windows) https://cygwin.com/packages/summary/cygutils.html
- clip, powershell (Windows) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/clip
- termux (via termux-clipboard-set, termux-clipboard-set)
- tmux (if $TMUX is set)

Expand Down

0 comments on commit 60ea046

Please sign in to comment.