Replies: 2 comments
-
I think you want |
Beta Was this translation helpful? Give feedback.
0 replies
-
# select script command from package.json and place it on the command line, but don't execute it
nr() {
local script
script=$(jq -r '.scripts | to_entries[] | [.key, .value] | @tsv' <package.json | sort |
fzf --exit-0 --delimiter '\t' --with-nth 1 --height 45% \
--cycle --border-label " package.json script " \
--border rounded --color 'border:255,label:244:bold' \
--preview-window "nohidden:down:border:wrap" \
--preview 'bat -pl sh <<<{2}')
print -nz "pnpm --silent run ${script%%$'\t'*} $*"
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
man fzf
)Info
Problem / Steps to reproduce
I want to use fzf and zoxide as path selection for any command.
for ex:
when I selected the path in fzf TUI, the command
cp
will execute and report the destinamtion is missing.I hope the selected path is pasted on the place only.
I am not familar with zsh zle. I tried to emulate the built-in fzf script and use
alt+o
to trigger completion. but it doesn't work.fzf solution
following
Custom fuzzy completion
I use the following method.
then I input
cp **<TBA>
, it will paste the selection on the command. I want to know if it's possible to paste the selected string got from fzf into the command line instead of defining completion for the comand one by one.Beta Was this translation helpful? Give feedback.
All reactions