3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

wsl2のneovimでWindows側とクリップボード共有をする

Last updated at Posted at 2022-02-26

Clip.exeに出力する方法

  • ヤンクするたびにとても待たされてしまい、微妙かもしれない

init.vimに追記しておく

~/.config/nvim/init.vim
if system('uname -a | grep microsoft') != ''
  augroup myYank
    autocmd!
    autocmd TextYankPost * :call system('clip.exe', @")
  augroup END
endif"

参考

Invoke-WebRequest `
    -Uri "https://github.com/equalsraf/win32yank/releases/latest/download/win32yank-x64.zip" `
    -OutFile C:\win32yank.zip

Expand-Archive C:\win32yank.zip -DestinationPath C:\WINDOWS\system32\

Remove-Item C:\win32yank.zip

win32yamk.exeにわたす

clip.exeよりも早い

init.vimに追記しておく

let g:clipboard = {
    \   'name': 'myClipboard',
    \   'copy': {
    \      '+': 'win32yank.exe -i',
    \      '*': 'win32yank.exe -i',
    \    },
    \   'paste': {
    \      '+': 'win32yank.exe -o',
    \      '*': 'win32yank.exe -o',
    \   },
    \   'cache_enabled': 1,
    \ }

参考

https://www.rhpav7.com/posts/wsl-vim-clipboard/
https://qiita.com/tMinamiii/items/0c6589806090c7fc3f8a

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?