LoginSignup
0
0

More than 1 year has passed since last update.

【WSL2/Windows11】LunarVimでyankしたものを外で貼り付けできなかった

Last updated at Posted at 2022-10-29

問題点

  • LunarVimでyank(yyや:%y)したものをGoogle Chromeに貼り付けようとしたらChromeが応答停止した.
  • NeoVimでも同じことが起こった.
  • メモ帳に貼り付けようとしても反応しない.
  • メモ帳→Chrome間ではコピー&ペーストが正常.

環境

  • LunarVim(NeoVim v0.9.0-dev)
  • WSL2 Ubuntu 20.04.5 LTS

解決

  • Windows11で使っているwin32yank.exeと, LunarVim内で使っているコピペソフトが違うらしい
  • Windows11で使っているwin32yank.exeをLunarVimに使わせてやればいい.
  • つまりwsl2の中から見たWindows11内のwin32key.exeのシンボリックリンクをLunarVimが参照するwin32key.exeに張ればいい.

To use the Windows clipboard from within WSL, win32yank.exe has to be on our $PATH.

If Neovim is installed on both Windows and within the WSL distribution, the win32yank.exe binary provided by the Neovim Windows installation can be symlinked to a directory included in our $PATH so it can be found by Neovim on WSL. Replace $NEOVIM_WIN_DIR with the path to our Neovim Windows installation, e.g. /mnt/c/Program Files/Neovim. The command can then be symlinked using:

# 例
% sudo ln -s /mnt/c/Program\ Files/Neovim/bin/win32yank.exe /usr/local/bin/win32yank.exe
  • xclipが存在してたらそれをsudo rm -rf xclipしなければ, win32yankではなくxclipが使われてしまう.

If it does not work, you can debug it using :checkhealth to identify any issues, e.g., there could be xclip installed and taking precedent over win32yank.

## これでは意味がない
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0