mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 17:13:42 -05:00
Add key binding to yank current entry to clipboard in Wayland.
11
Examples.md
11
Examples.md
@@ -57,6 +57,7 @@ Table of Contents
|
||||
* [dotfiles management](#dotfiles-management)
|
||||
* [Transmission](#transmission)
|
||||
* [Pacman](#pacman)
|
||||
* [Copy current item to clipboard](#clipboard)
|
||||
|
||||
|
||||
### General
|
||||
@@ -1656,3 +1657,13 @@ function re() {
|
||||
yay -Qq | fzf -q "$1" -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns
|
||||
}
|
||||
```
|
||||
|
||||
### Clipboard
|
||||
Uses [wl-copy](https://github.com/bugaevc/wl-clipboard) to copy the current entry to the clipboard on Wayland:
|
||||
|
||||
```sh
|
||||
export FZF_DEFAULT_OPTS='--bind "ctrl-y:execute-silent(printf {} | cut -f 2- | wl-copy --trim-newline)"'
|
||||
```
|
||||
|
||||
This works with `execute-silent` but not with `execute`, presumably because `execute` waits for `wl-copy` to end. Appending a `&` did not change that.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user