Skip to content

Instantly share code, notes, and snippets.

@uchida
Created September 16, 2025 04:34
Show Gist options
  • Save uchida/8eaae119fa46340f87c2fe893e4367cd to your computer and use it in GitHub Desktop.
Save uchida/8eaae119fa46340f87c2fe893e4367cd to your computer and use it in GitHub Desktop.
function ghd() {
local root=$(ghq root)
local selected=$(
ghq list | while read repo; do
local repo_path="$root/$repo"
local score=$(
(zoxide query --score "$repo_path" 2>/dev/null || echo 0) |
awk '{print $1}'
)
echo "$score $repo"
done | sort -rn | cut -d ' ' -f 2- | fzf)
if [[ -n "$selected" ]]; then
cd "$root/$selected"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment