From afbf7040a8256e8a63aa4066c81d18ff83b2692a Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 12 Oct 2021 11:29:05 +0200 Subject: [PATCH] config/shell/browse: fix zoxide parsing --- .config/shell/browse | 2 +- .local/bin/scripts/zfz | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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|.* /|/|'