aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShivam Mehta <sm.cse17@gmail.com>2021-05-30 05:57:14 +0530
committerShivam Mehta <sm.cse17@gmail.com>2021-05-30 06:42:34 +0530
commitadb23c1e860d1ac9a528d6abe67c3081f6d6177b (patch)
treed6d22d5cf4a7b0143b6bebfb7b0a420600680449
parent5b202610ae9dd788a4c07e18c07a2634854401cd (diff)
downloadfork-tmux-fzf-url-adb23c1e860d1ac9a528d6abe67c3081f6d6177b.tar.gz
fork-tmux-fzf-url-adb23c1e860d1ac9a528d6abe67c3081f6d6177b.tar.bz2
fork-tmux-fzf-url-adb23c1e860d1ac9a528d6abe67c3081f6d6177b.zip
Using entire buffer scrollback as target content
-rwxr-xr-xfzf-url.sh2
-rwxr-xr-xfzf-url.tmux3
2 files changed, 3 insertions, 2 deletions
diff --git a/fzf-url.sh b/fzf-url.sh
index d3fbf77..4bd4fd8 100755
--- a/fzf-url.sh
+++ b/fzf-url.sh
@@ -19,7 +19,7 @@ open_url() {
fi
}
-content="$(tmux capture-pane -J -p)"
+content="$(tmux capture-pane -J -p -S -"$2")"
mapfile -t urls < <(echo "$content" |grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')
mapfile -t wwws < <(echo "$content" |grep -oE 'www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/')
diff --git a/fzf-url.tmux b/fzf-url.tmux
index 6eb145c..3f5d166 100755
--- a/fzf-url.tmux
+++ b/fzf-url.tmux
@@ -15,7 +15,8 @@ tmux_get() {
}
key="$(tmux_get '@fzf-url-bind' 'u')"
+historyLimit="$(tmux_get 'history-limit' '2000')"
extra_filter="$(tmux_get '@fzf-url-extra-filter' '')"
echo "$extra_filter" > /tmp/filter
-tmux bind-key "$key" run -b "$SCRIPT_DIR/fzf-url.sh '$extra_filter'";
+tmux bind-key "$key" run -b "$SCRIPT_DIR/fzf-url.sh '$extra_filter' '$historyLimit'";