bindkey'\e[0n' kill-whole-line _z_comp() { local list=$(_zlua -l ${words[2,-1]}) if [ -n "$list" ]; then local selected=$(print$list | ${=zlua_fzf} | sed 's/^[0-9,.]* *//') if [ -n "$selected" ]; then cd${selected} printf'\e[5n' fi fi } _zc_comp() { local -a list=("${(@f)$(fdfind -t d -d 1 .)}") for ((i=1;i<=$#list;i++)){ list[i]=${list[i]/\//} } if [ -n "$list" ]; then local selected=$(print$list | awk -F " "'{for(row=1;row<=NF;row++) print $row;}' | ${=zlua_fzf}) if [ -n "$selected" ]; then cd${selected} printf'\e[5n' fi fi } _zlua_comp() { _arguments -C -S -s \ '*:enter directory order by frecent:_z_comp' \ '-c:enter subdirectory:_zc_comp' } compdef _zlua_comp _zlua > /dev/null 2>&1 compdef ${_ZL_CMD:-z}=_zlua