function ghq_rm
  set -l projects (ghq list --exact | fzf --multi --prompt "Project: ")

  if test -n "$projects"
    for proj in $projects
      set -l proj_dir (ghq list --full-path "$proj")
      ghq rm "$proj"; and rmdir -p --ignore-fail-on-non-empty (dirname "$proj_dir")
    end
  end
end
