34 lines
611 B
Bash
34 lines
611 B
Bash
|
# exa
|
||
|
if (( $+commands[exa] )); then
|
||
|
# exa explorer
|
||
|
exex() {
|
||
|
local depth=1
|
||
|
local old_depth=0
|
||
|
local min_depth=1
|
||
|
local max_depth=3
|
||
|
local exa_opts=("--color=always" "--git" "--icons" "-F" "-T")
|
||
|
|
||
|
while true; do
|
||
|
if [[ $depth -ne $old_depth ]]; then
|
||
|
local old_depth=$depth
|
||
|
clear
|
||
|
exa $exa_opts -L$depth
|
||
|
fi
|
||
|
|
||
|
read -sk key
|
||
|
|
||
|
case $key in
|
||
|
h)
|
||
|
[[ $depth -gt $min_depth ]] && (( depth-- ))
|
||
|
;;
|
||
|
l)
|
||
|
[[ $depth -lt $max_depth ]] && (( depth++ ))
|
||
|
;;
|
||
|
q)
|
||
|
break
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
}
|
||
|
fi
|