You are not logged in.
What does being fuzzy mean?
Vague or imprecise. synonyms ▲ Synonyms: ambiguous, equivocal; see also Thesaurus:vague. My recollection of that event is fuzzy. Not clear; unfocused. synonyms ▲ Synonyms: blurry, ill-defined; see also Thesaurus:indistinct.
alias launch='unset arr;arr=();arr+=($(compgen -c | fzy -p "launch >> ")) && "${arr[@]}"'
alias cdf='cd "$(fdfind -H -L -t d -d 3 | fzf -0 --height=10 --layout=reverse)"'
1st one needs 'fzy' (in repos), 2nd one needs 'fzf' and 'fd-find' (in repos).
cdf ** in action:
* Disclaimer: This is what it is: experiments, there is no doubt a better way to do this sort of stuff. Also there may be a way to do such stuff with fzf or fzy natively, that I'am not aware off.
** Turns out that fzf already comes with a cdf like widget, called 'fzf-cd-widget' (default keybind is alt+c).
Last edited by brontosaurusrex (2023-06-13 09:42:49)
Offline
The whole thing is fuzzy to me.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Online
asciiDemo: https://asciinema.org/a/oDodjH9TcVuumN2Ea6w5eWB0z
More: https://brontosaurusrex.github.io/2022/ … zy-launch/
Last edited by brontosaurusrex (2022-11-27 12:41:31)
Offline
Now that is really above my paygrade¹
But looks interesting as all get up and go!
_________________
¹ brain cell capacity
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Online
To check out what Brontosaurusrex has going above, I did this:
sudo apt install fzy fzf fd-find
and then:
fdfind -H -L -t d -d 3 | fzf -0 --height=10 --layout=reverse
in a terminal to see how it worked without setting up the alias.
To try the whole setup, I placed the alias lines at the end of ~/.bashrc and called it all with:
cdf
Just a really neat idea for a sort of terminal menu of existing files. fdfind to search and fzf to sort into a better order. Brilliant.
@Brontosuarusrex, Did you have a specific use in mind?
Last edited by sleekmason (2022-11-27 16:34:22)
Offline
@sleekmason, Well yes, one is 'launcher', another one is 'cd to', there is a third one called 'comhis'
# functions
comhis () {
# Noninteractive fuzzy search history and available commands
if (( $# )) ; then
var="$*"
{ { history | awk '{$1=""; print $0;}' | sed 's/^ //g'; } & compgen -c; } \
| fzy -e "$var" | uniq | head -20 | column
fi
}
which is non-interactive and just searches history (if you happen to have the history format 'correct') and executables and prints them out. There must be a lot more here to discover.
p.s. Also 'cdf' and 'launch', if they survive the testing stage may be better out bind to a certain keys (instead of aliased).
Last edited by brontosaurusrex (2022-11-27 17:34:52)
Offline
Just neat. Thank you for sharing your work!
Offline