From 308191e23df1b55515df0d1e6b359535a201022e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 16 Apr 2018 02:24:33 -0400 Subject: add tmux keybinding to open the most recent url in a browser --- bin/find-urls | 8 ++++++++ tmux.conf | 1 + 2 files changed, 9 insertions(+) create mode 100755 bin/find-urls diff --git a/bin/find-urls b/bin/find-urls new file mode 100755 index 0000000..e41363a --- /dev/null +++ b/bin/find-urls @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.014; + +use URL::Search 'extract_urls'; + +say for extract_urls(do { local $/; <> }); diff --git a/tmux.conf b/tmux.conf index 251764e..727b94c 100644 --- a/tmux.conf +++ b/tmux.conf @@ -36,6 +36,7 @@ bind ^N new-window bind ^D detach-client bind ^[ copy-mode bind { copy-mode +bind Enter run 'tmux capture-pane -p | find-urls | tail -n1 | xargs xdg-open' unbind ^B -- cgit v1.2.3-54-g00ecf