aboutsummaryrefslogtreecommitdiff
path: root/scripts/path_search.sh
blob: d473607a3c232e70161c793163a71474955b2b9f (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-26
#
# Description: Search buffer for unix paths in current tmux pane and send
# results to fzf to copy to clipboard

URL=$(tmux capture-pane -pS -30000 | perl -wnl -e '/\S*(html|py|md|txt|pdf|js|ini|json)$/ and print $&' | awk '!x[$0]++' | fzf-tmux)
if [[ -n "$URL" ]]; then
    echo "$URL" | xp
fi