Created
June 15, 2018 20:39
-
-
Save hktonylee/ca56920dd0323c1c40726764d1d21b7e to your computer and use it in GitHub Desktop.
Interactively open URLs
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
#!/usr/bin/env fish | |
function +fzf_open_url | |
[ -z "$FZF_OPEN_URL_LIST" ]; and echo "Please configure \$FZF_OPEN_URL_LIST first." >&2; and return | |
set -l result ( \ | |
cat $FZF_OPEN_URL_LIST \ | |
| sort \ | |
| uniq \ | |
| grep -ve '^$' \ | |
| fzf --bind "enter:execute-silent:open {}" \ | |
) | |
# [ $status -eq 0 ]; and open $result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment