Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Getting Copy / Paste to Work in WSL with tmux and Terminal Vim


Getting your system clipboard to work with tmux and Vim can be tricky. Here's a short video showing how to set it all up.

Quick Jump: Demo Video Showing How It Works

By the end of this video you’ll have your clipboard working across all terminal applications, and even be able to copy and paste between a WSL terminal and Windows. Also, if you’re not using WSL most of the video applies to MacOS and native Linux too.

Demo Video Showing How It Works

Timestamped Table of Contents

  • 0:44 – Getting familiar with your terminal
  • 1:37 – Copy / pasting text in your terminal
  • 2:17 – Copying text with tmux using the mouse
  • 3:08 – Configuring tmux to copy text with the mouse
  • 4:46 – Demonstrating why tmux-yank is so useful
  • 6:21 – Avoiding shift select to copy text with multiple tmux panes
  • 7:39 – Demonstrating the same shift select problem with Vim
  • 8:50 – Configuring Vim to use the system clipboard for yanking and pasting
  • 12:35 – Setting up VcXsrv to link your WSL and Windows clipboard
  • 15:06 – Getting VcXsrv to start when Windows boots up

Were you able to get everything working? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per month (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.