aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenxuan <wenxuangm@gmail.com>2018-04-06 11:56:30 +0800
committerWenxuan <wenxuangm@gmail.com>2018-04-06 11:56:30 +0800
commit296e879633744cc87369847e78706f8c4aa3e15f (patch)
tree512987e313ea739e92ece77a969d3b94e64df41e
parent9edbdc125c3d798de0b48fe5fccea0d4fbd2376a (diff)
downloadfork-tmux-fzf-url-296e879633744cc87369847e78706f8c4aa3e15f.tar.gz
fork-tmux-fzf-url-296e879633744cc87369847e78706f8c4aa3e15f.tar.bz2
fork-tmux-fzf-url-296e879633744cc87369847e78706f8c4aa3e15f.zip
Improve fzf options
-rwxr-xr-xfzf-url.tmux6
1 files changed, 3 insertions, 3 deletions
diff --git a/fzf-url.tmux b/fzf-url.tmux
index 08f9d73..878dae2 100755
--- a/fzf-url.tmux
+++ b/fzf-url.tmux
@@ -13,8 +13,8 @@ tmux_set() {
tmux set-option -gq "$1" "$2"
}
-url_reg='\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'
-fzf_url_cmd="tmux capture-pane -J -p |grep -oE '"$url_reg"' |fzf-tmux"
+fzf_cmd="fzf-tmux --multi --cycle --reverse --bind='ctrl-u:half-page-up' --bind='ctrl-d:half-page-down' --bind='ctrl-r:toggle-all' --bind='ctrl-s:toggle-sort'"
+url_regex='\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'
if hash xdg-open &>/dev/null; then
open_cmd='nohup xdg-open'
elif hash open &>/dev/null; then
@@ -23,4 +23,4 @@ fi
key="$(tmux_get "@fzf-url-bind" "u")"
-tmux bind-key "$key" run -b "tmux capture-pane -J -p |grep -oE '"$url_reg"' |sort -u |fzf-tmux | xargs $open_cmd &>/dev/null || true";
+tmux bind-key "$key" run -b "tmux capture-pane -J -p |grep -oE '"$url_regex"' |sort -u |nl -w3 -s' ' |$fzf_cmd |awk '{print \$2}'| xargs $open_cmd &>/dev/null || true";