diff --git a/.config/shell/browse b/.config/shell/browse index dca7bf4..4e2dea7 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -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)" diff --git a/.local/bin/scripts/zfz b/.local/bin/scripts/zfz index e775ede..59d91d8 100755 --- a/.local/bin/scripts/zfz +++ b/.local/bin/scripts/zfz @@ -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|.* /|/|'