diff options
author | Ben Sima <ben@bsima.me> | 2022-02-09 18:20:21 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-02-09 18:20:21 -0500 |
commit | 648dc18aa15fb8e25d8d0a0f06e2be8f1a222ac5 (patch) | |
tree | 5db6e403037dfd21b43c95a32c43bee501342296 | |
parent | f57b987ce66957a86baa846a813d5d3ddee6c6db (diff) |
Use fzf-tmux and add hoog.sh to ghci
-rw-r--r-- | .ghci | 3 | ||||
-rwxr-xr-x | Biz/Ide/ftags.sh | 2 | ||||
-rwxr-xr-x | Biz/Ide/hoog.sh | 9 | ||||
-rwxr-xr-x | Biz/Ide/ns | 4 |
4 files changed, 11 insertions, 7 deletions
@@ -8,5 +8,6 @@ :def iq (\arg -> let [x, y] = Prelude.words arg in return <| "import qualified " ++ x ++ " as " ++ y) :def hoogle \s -> return <| ":! hoogle search --count=15 \"" ++ s ++ "\"" :def hdoc \s -> return <| ":! hoogle search --info \"" ++ s ++ "\"" -:def! f \_ -> return <| ":! ftags \n:r" +:def! f \_ -> return <| ":! ftags.sh \n:r" +:def! h \_ -> return <| ":! hoog.sh" :def test \_ -> return <| ":main test" diff --git a/Biz/Ide/ftags.sh b/Biz/Ide/ftags.sh index 77646da..fba7fb0 100755 --- a/Biz/Ide/ftags.sh +++ b/Biz/Ide/ftags.sh @@ -7,7 +7,7 @@ tag_search=$( awk 'BEGIN { FS="\t" } !/^!/ {print toupper($4)"\t"$1"\t"$2"\t"$3}' "$tags" \ | cut -c1-80 \ - | fzf \ + | fzf-tmux \ --nth=1,2 \ --preview-window=down \ --preview "rg --ignore-case --pretty --context 2 --word-regexp {+2}" diff --git a/Biz/Ide/hoog.sh b/Biz/Ide/hoog.sh index 3945f90..976f0d4 100755 --- a/Biz/Ide/hoog.sh +++ b/Biz/Ide/hoog.sh @@ -5,10 +5,13 @@ set -euo pipefail HOOG="hoogle search --count=200" export FZF_DEFAULT_COMMAND="$HOOG $*" - fzf \ + result=$(fzf-tmux \ --preview-window=down \ --preview "hoogle search --link --info {+2}" \ --bind "change:reload:$HOOG {q} || true" \ - --print-query \ - --ansi + --ansi \ + | cut -d' ' -f 1,2 \ + | sed -e 's/ /./g' + ) + hoogle search --info "$result" ## @@ -2,12 +2,12 @@ ## if [[ $NOUN == "" ]] then - export NOUN=$(fd --exclude=_ -t f . $BIZ_ROOT | fzf) + export NOUN=$(fd --exclude=_ -t f . $BIZ_ROOT | fzf-tmux) fi ## if [[ $VERB == "" ]] then - export VERB=$(fzf <<< $(sed 's/ /\n/g' <<< "edit bild push ship lint")) + export VERB=$(fzf-tmux <<< $(sed 's/ /\n/g' <<< "edit bild push ship lint")) fi ## $VERB $NOUN |