config/shell/browse: fix zoxide parsing

This commit is contained in:
xeruf 2021-10-12 11:29:05 +02:00
parent 3c68dc3657
commit afbf7040a8
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ d() {
# First find out whether there is an obvious match
# (score at least ten times above runner-up and score above 20)
# If not select with fzf, using locate to find extra options
cd "$(if expr "$(echo "$query" | head -1 | cut -d' ' -f2)" \> 20 \& $(echo "$query" | sed 'N;s|/.*\n|> 10 *|;q' | sed 's| */.*||') >/dev/null 2>&1
cd "$(if expr "$(echo "$query" | head -1 | cut -d' ' -f1)" \> 20 \& $(echo "$query" | sed 'N;s|/.* \([0-9]\)|> 10 * \1|;q' | sed 's| */.*||') >/dev/null #2>&1
then echo "$query" | head -1
else echo "$query"; locz "$@"
fi | zfz)"

View File

@ -1,3 +1,3 @@
#!/bin/sh
# fzf for zoxide
fzf -0 -1 -n2.. --tiebreak=index --preview="ls -a --color --human-readable --group-directories-first --file-type {2..}" --preview-window=20% | tr -s ' ' | cut -d' ' -f3-
fzf -0 -1 -n2.. --tiebreak=index --preview="ls -a --color --human-readable --group-directories-first --file-type {2..}" --preview-window=20% | sed 's|.* /|/|'