diff options
-rwxr-xr-x | scripts/path_search.sh | 12 | ||||
-rw-r--r-- | stow/tmux/.tmux.conf | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/scripts/path_search.sh b/scripts/path_search.sh new file mode 100755 index 0000000..c6ee062 --- /dev/null +++ b/scripts/path_search.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# vim: set filetype=sh +# +# Author: Cody Hiar +# Date: 2019-04-26 +# +# Description: Search buffer for unix filepaths + +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 diff --git a/stow/tmux/.tmux.conf b/stow/tmux/.tmux.conf index de4dbf3..b0521e5 100644 --- a/stow/tmux/.tmux.conf +++ b/stow/tmux/.tmux.conf @@ -25,7 +25,7 @@ bind p run-shell "bash $HOME/.tmux/scripts/rolodex.sh prev" bind C-u run-shell "bash $HOME/.tmux/scripts/url_search.sh" # Bind the last window/pane command bind C-b last-pane -bind C-f last-window +bind C-f run-shell "bash $HOME/.tmux/scripts/path_search.sh" # Faster window switching bind C-n next-window bind C-p previous-window |