diff --git a/assets/default/fish/functions/yk-copy.fish b/assets/default/fish/functions/yk-copy.fish new file mode 100644 index 0000000..74c8f21 --- /dev/null +++ b/assets/default/fish/functions/yk-copy.fish @@ -0,0 +1,13 @@ +function yk-copy --description "Select a credential using fzf and copy it to clipboard" + set result (yk (yk list | fzf)) + + if command -q pbcopy + echo "$result" | pbcopy + else if command -q xsel + echo "$result" | xsel --clipboard + else if command -q xclip + echo "$result" | xclip + else + echo "No clipboard command found. Code is $result" + end +end