summaryrefslogtreecommitdiff
path: root/Biz/Ide/hoog
blob: 976f0d461fab1e258f80992cd4508c46be31e2d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash
#
# search hoogle with fzf
#
  set -euo pipefail
  HOOG="hoogle search --count=200"
  export FZF_DEFAULT_COMMAND="$HOOG $*"
  result=$(fzf-tmux \
    --preview-window=down \
    --preview "hoogle search --link --info {+2}" \
    --bind "change:reload:$HOOG {q} || true" \
    --ansi \
    | cut -d' ' -f 1,2 \
    | sed -e 's/ /./g'
  )
  hoogle search --info "$result"
##