aboutsummaryrefslogtreecommitdiff
path: root/scripts/url_search.sh
blob: 497b09c592f87f243520bae01193a456d98cd14c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
# vim: set filetype=sh
#
# Author: Cody Hiar
# Date: 2019-04-25
#
# Description: Search buffer for url results

PANE_HISTORY="$(tmux capture-pane -J -p)"
URL=$(echo "$PANE_HISTORY" | perl -wnl -e '/https?\:\/\/[^\s]+[\/\w]/ and print $&' | fzf-tmux)
if [[ -n "$URL" ]]; then
    echo "$URL" | xp
fi