Synchronize files between the Yazi file manager and your system clipboard. Supports both copy and paste on Linux, macOS, and Windows desktops.
- Copy: Yank files in Yazi and make them available to other applications via the system clipboard.
- Paste: Copy files from the system clipboard into the current Yazi directory, with conflict resolution (overwrite / rename / skip).
| Platform | Copy | Paste |
|---|---|---|
| Linux (X11) | xclip |
xclip |
| Linux (Wayland) | wl-copy (wl-clipboard) |
wl-paste (wl-clipboard) |
| macOS | Built-in osascript |
Built-in osascript |
| Windows | Built-in powershell.exe |
Built-in powershell.exe |
Install the plugin via the package manager:
ya pkg add XYenon/clipboardThis clones the repository, adds it to ~/.config/yazi/package.toml, and pins the current revision.
Add shortcuts in ~/.config/yazi/keymap.toml:
# Copy yanked files to the system clipboard
[[mgr.prepend_keymap]]
on = "y"
run = [ "yank", 'plugin clipboard -- --action=copy' ]
desc = "Yank selected files (copy)"
# Keep behaviour consistent with cut
[[mgr.prepend_keymap]]
on = "x"
run = [ "yank --cut", 'plugin clipboard -- --action=copy' ]
desc = "Yank selected files (cut)"
# Paste files from the system clipboard into the current directory
[[mgr.prepend_keymap]]
on = "<C-p>"
run = [ 'plugin clipboard -- --action=paste' ]
desc = "Paste yanked system clipboard files"The plugin accepts the boolean argument notify-unknown-display-server:
- Default
false: silently exit when the Linux display server is unknown (useful for TTY or remote sessions). true: show a notification to warn that the operation is unavailable in the current session.
Example invocation:
[[mgr.prepend_keymap]]
on = "y"
run = [ "yank", 'plugin clipboard -- --action=copy --notify-unknown-display-server' ]Copy failed: xclip/wl-copy not found: installxclipfor X11 orwl-clipboard(wl-copy) for Wayland.Paste failed: xclip/wl-paste not found: installxclipfor X11 orwl-clipboard(wl-paste) for Wayland.Unknown display server: ensure Yazi runs in a Wayland or X11 session. Enablenotify-unknown-display-serverto surface a visible warning.powershell.exe not found: ensure%SystemRoot%\System32\WindowsPowerShell\v1.0is on yourPATH.
This repository uses treefmt for formatting:
nix fmtFeel free to open a PR to support more desktop environments.