2025-10-23
Use tmux save-buffer to sync clipboard
2025-10-23 ~ 2026-01-01

The note is generated by ChatGPT.

This note explains how to:

  1. Synchronize text copied in a remote Neovim session with your local clipboard via tmux.
  2. Implement a cpwd command to copy the current working directory of your shell to the local clipboard.
  3. Understand the underlying principle of how tmux buffers bridge remote Neovim and local clipboard.

1. Prerequisites

  • tmux 3.3a+ (supports load-buffer -w)
  • Neovim installed on the remote server

2. Principle: How tmux Buffers Bridge Remote and Local Clipboard

  1. tmux Buffers as an Intermediate Clipboard