#!/bin/sh -e cmd=www # regexp is taken from urlview grep -P -o '(((http|https|ftp|gopher)|mailto):(//)?[^ <>\"\t]*|(www|ftp)[0-9]?\\.[-a-z0-9.]+)[^ .,;\t\n\r<\">\\):]?[^, <>\"\t]*[^ .,;\t\n\r<\">\\):]' "$@" | fzf --bind="enter:execute($cmd {})" \ --bind="ctrl-f:execute(rlwrap --pre-given={} head -1 | xargs $cmd)"