mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 08:13:40 -05:00
Updated Examples (markdown)
@@ -1480,6 +1480,8 @@ So you'll need:
|
||||
#!/usr/bin/env bash
|
||||
# fzfmenu - fzf as dmenu replacement
|
||||
|
||||
# fifos are here to not wait for end of input
|
||||
# (useful for e.g. find $HOME | fzfmenu ...)
|
||||
input=$(mktemp -u --suffix .fzfmenu.input)
|
||||
output=$(mktemp -u --suffix .fzfmenu.output)
|
||||
mkfifo $input
|
||||
@@ -1488,10 +1490,10 @@ chmod 600 $input $output
|
||||
|
||||
# it's better to use st here (starts a lot faster than pretty much everything else)
|
||||
# the ugly printf | sed thing is here to make args with quotes work.
|
||||
# (e.g. --preview='echo {1}')
|
||||
# (e.g. --preview='echo {1}').
|
||||
# sadly we can't use "$@" here directly because we are inside sh -c "..." call
|
||||
# already
|
||||
|
||||
# already.
|
||||
# you can also set window dimensions via -g '=ROWxCOLS', see man st.
|
||||
st -c fzfmenu -n fzfmenu -e sh -c "cat $input | fzf $(printf -- " '%s'" "$@" | sed "s/^ ''$//") | tee $output" & disown
|
||||
|
||||
# handle ctrl+c outside child terminal window
|
||||
|
||||
Reference in New Issue
Block a user