Fix exex
This commit is contained in:
parent
fcae78acf2
commit
5acfc2ad28
16
zshrc
16
zshrc
@ -124,20 +124,26 @@ if (( $+commands[exa] )); then
|
|||||||
# exa explorer
|
# exa explorer
|
||||||
exex() {
|
exex() {
|
||||||
local depth=1
|
local depth=1
|
||||||
|
local old_depth=0
|
||||||
|
local min_depth=1
|
||||||
|
local max_depth=3
|
||||||
local exa_opts=("--color=always" "--git" "--icons" "-F" "-T")
|
local exa_opts=("--color=always" "--git" "--icons" "-F" "-T")
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
if [[ $depth -ne $old_depth ]]; then
|
||||||
exa $exa_opts -L$depth $@
|
local old_depth=$depth
|
||||||
|
clear
|
||||||
|
exa $exa_opts -L$depth
|
||||||
|
fi
|
||||||
|
|
||||||
read -sk key
|
read -sk key
|
||||||
|
|
||||||
case $key in
|
case $key in
|
||||||
h)
|
h)
|
||||||
(( depth-- ))
|
[[ $depth -gt $min_depth ]] && (( depth-- ))
|
||||||
[[ $depth -lt 1 ]] && local depth=1
|
|
||||||
;;
|
;;
|
||||||
l)
|
l)
|
||||||
(( depth++ ))
|
[[ $depth -lt $max_depth ]] && (( depth++ ))
|
||||||
;;
|
;;
|
||||||
q)
|
q)
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user