~enan/dotfiles

f4591bd5e635be79197c752c43a6163a2d509f93 — Enan Ajmain 1 year, 9 months ago 0d0ad61
vim: use native Windows tools instead of win32yank
2 files changed, 26 insertions(+), 6 deletions(-)

M .config/nvim/plugin/user/clipboard.vim
A bin/wslyank
M .config/nvim/plugin/user/clipboard.vim => .config/nvim/plugin/user/clipboard.vim +6 -6
@@ 13,16 13,16 @@ if g:env == "UNIX"
        \ }
elseif g:env == "WSL"
  let g:clipboard = {
        \   'name': 'win32yank_nvim',
        \   'name': 'wslyank_nvim',
        \   'copy': {
        \      '+': 'win32yank.exe -i --crlf',
        \      '*': 'win32yank.exe -i --crlf',
        \      '+': 'wslyank -i',
        \      '*': 'wslyank -i',
        \    },
        \   'paste': {
        \      '+': 'win32yank.exe -o --lf',
        \      '*': 'win32yank.exe -o --lf',
        \      '+': 'wslyank -o',
        \      '*': 'wslyank -o',
        \   },
        \   'cache_enabled': 1,
        \   'cache_enabled': 0,
        \ }
endif


A bin/wslyank => bin/wslyank +20 -0
@@ 0,0 1,20 @@
#!/bin/env bash

# /mnt/c/Windows/System32/clip.exe
# /mnt/c/Windows/System32/paste.exe | sed 's/\r//g'

while getopts 'io' OPTION
do
  case $OPTION in
    i)
      /mnt/c/Windows/System32/clip.exe
      ;;
    o)
      /mnt/c/Windows/System32/paste.exe | sed 's/\r//g'
      ;;
    ?)
      printf "Internal error" $(basename $0) >&2
      exit 2
      ;;
  esac
done