From 572cea8351dd5c8d25d5fbfaacdbb47ca5f10c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl-Einar=20Bergstr=C3=B8m?= Date: Wed, 14 Oct 2026 13:29:59 +0200 Subject: [PATCH] docs: the fzf example for lazysecrets list hides the link and binds open and copy --- cmd/lazysecrets/list.go | 2 +- docs/links.md | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/lazysecrets/list.go b/cmd/lazysecrets/list.go index d7b0dc5..9e0ae91 100644 --- a/cmd/lazysecrets/list.go +++ b/cmd/lazysecrets/list.go @@ -26,7 +26,7 @@ import ( // listCmd prints every source, vault and secret lazysecrets can find, one // per line, for fzf, editor pickers and scripts: // -// lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 | cut -f2 +// lazysecrets list | fzf --ansi --with-nth='..-2' --accept-nth=-1 // // Each line is the name, then the link: the name coloured from the theme, // with the provider's icon (as in the TUI: --icons, LAZYSECRETS_ICONS, diff --git a/docs/links.md b/docs/links.md index 1c4e6e6..b771b7a 100644 --- a/docs/links.md +++ b/docs/links.md @@ -144,11 +144,18 @@ tab-separated. It's what Go to searches, so fzf, or an editor's picker, can search it instead, showing the names and acting on the links: ```sh -lazysecrets list | fzf --ansi --delimiter='\t' --with-nth=1 \ - --bind 'enter:become(lazysecrets open {2})' \ - --bind 'ctrl-y:execute-silent(lazysecrets get {2} | pbcopy)' +lazysecrets list | fzf --ansi --with-nth='..-2' --accept-nth=-1 \ + --bind 'ctrl-o:become(lazysecrets open {-1})' \ + --bind 'ctrl-y:execute-silent(lazysecrets get {-1} | pbcopy)' ``` +`--with-nth='..-2'` shows and searches the names, leaving out the link, +the last field; `{-1}` and `--accept-nth=-1` are the link. `enter` prints +it (`lazysecrets get $(…)`), `ctrl-o` opens it in lazysecrets and `ctrl-y` +copies the value (`pbcopy` on macOS; `wl-copy` or `xclip` on Linux). A +value copied this way isn't cleared from the clipboard after +`values.clipboardClear`, as one copied in lazysecrets is. + What's [cached](config.md#cache) prints at once. Then, like Go to, it loads what's missing or older than `--max-age` (2m), and what's new in it follows as it arrives: fzf shows it while you type. `--cached` loads nothing from