From fa745c5088642ed2d0b5a531861faca2348824d4 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Sun, 13 Sep 2020 02:14:37 +1000 Subject: [PATCH] Fix WSL2 Neovim clipboard --- ubuntu-bootstrap.sh | 5 +++++ wsl2-bootstrap.sh | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 wsl2-bootstrap.sh diff --git a/ubuntu-bootstrap.sh b/ubuntu-bootstrap.sh index d453ce8..6b1176c 100755 --- a/ubuntu-bootstrap.sh +++ b/ubuntu-bootstrap.sh @@ -50,6 +50,11 @@ if ! [ -d "/run/WSL" ]; then snap install spotify fi +if [ -d "/run/WSL" ]; then + echo "Running WSL2 bootstrap script" + sh ./wsl2-bootstrap.sh +fi + if ! command docker -v > /dev/null; then echo "Installing Docker" curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - diff --git a/wsl2-bootstrap.sh b/wsl2-bootstrap.sh new file mode 100644 index 0000000..44f6313 --- /dev/null +++ b/wsl2-bootstrap.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +# Makes WSL2 + Neovim use windows clipboard https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl +curl -sLo /tmp/win32yank.zip https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip +unzip -p /tmp/win32yank.zip win32yank.exe > /tmp/win32yank.exe +chmod +x /tmp/win32yank.exe +sudo mv /tmp/win32yank.exe ~/bin