Created
March 25, 2021 18:27
-
-
Save cirrusUK/210bc9ace69bfd627dbf90e4dc35c0a1 to your computer and use it in GitHub Desktop.
fuzzy finder for gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export DISPLAY=":0" | |
export XDG_RUNTIME_DIR=/run/user/$(id -u) | |
IFS=$'\n' | |
out=("$(gist -l | fzf -m --color dark,hl:172,hl+:46,fg+:26,bg+:235 --color info:150,prompt:26,spinner:150,pointer:26,marker:7,border:26 --border=sharp --prompt='➤ ' --pointer='➤ ' --marker='➤' --height 60% --expect=ctrl-o,ctrl-e | cut -d" " -f1 )") | |
key=$(head -1 <<< "$out") | |
file=$(head -2 <<< "$out" | tail -1) | |
if [ -n "$file" ] | |
then | |
[ "$key" = ctrl-o ] && ${BROWSER} "$file" || ${BROWSER} "$file" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment