From 95c1029b641cc54b49260be7d365a1978954b497 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 3 Aug 2011 10:14:22 +0200 Subject: [PATCH] url-select: g/G mappings to select first/last URL --- README.md | 4 ++-- url-select | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d90ce32..f42d019 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ After installing, put the following lines in your .Xdefaults/.Xresources: Use Meta-u to activate URL selection mode, then use the following keys: - k: Select next upward URL (also with Meta-u) - j: Select next downward URL + j/k: Select next downward/upward URL + g/G: Select first/last URL o/Return: Open selected URL in browser, Return: deactivate afterwards y: Copy (yank) selected URL and deactivate selection mode q/Escape: Deactivate URL selection mode diff --git a/url-select b/url-select index 6d36a9d..1440e9e 100644 --- a/url-select +++ b/url-select @@ -2,7 +2,7 @@ # Author: Bert Muennich # Website: http://www.github.com/muennich/urxvt-perls # Based on: http://www.jukie.net/~bart/blog/urxvt-url-yank -# Version: 1.5 +# Version: git-20110803 # License: GPLv2 # Use keyboard shortcuts to select URLs. @@ -14,8 +14,8 @@ # URxvt.keysym.M-u: perl:url-select:select_next # Use Meta-u to activate URL selection mode, then use the following keys: -# k: Select next upward URL (also with Meta-u) -# j: Select next downward URL +# j/k: Select next downward/upward URL +# g/G: Select first/last URL # o/Return: Open selected URL in browser, Return: deactivate afterwards # y: Copy (yank) selected URL and deactivate selection mode # q/Escape: Deactivate URL selection mode @@ -108,6 +108,12 @@ sub key_press { select_next($self, -1); } elsif ($char eq 'j') { select_next($self, 1); + } elsif ($char eq 'g') { + $self->{row} = $self->top_row - 1; + select_next($self, 1); + } elsif ($char eq 'G') { + $self->{row} = $self->nrow; + select_next($self, -1); } return 1;