WSL上のVimのyankをWindowsと共有する

.vimrc

 " WSL clipboard
 if !empty($WSL_DISTRO_NAME)
   let s:clip = '/mnt/c/Windows/System32/clip.exe'
   if executable(s:clip)
     augroup WSLYank
       autocmd!
       autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
     augroup END
   endif
 endif

参考

https://superuser.com/questions/1291425/windows-subsystem-linux-make-vim-use-the-clipboard


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2022-01-29 (土) 03:58:52