aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-11-27 11:12:08 +0100
committerAnton Khirnov <anton@khirnov.net>2021-11-27 11:12:08 +0100
commite41ee1401ca4e531bbdcd9c9195982eb088fc0bd (patch)
tree41dc7dfb1dffabdeceea88483d879d218609b9a7
parent8108c454e3133de2d9291c1bc58ef8c32e80fc6a (diff)
Update README.
-rw-r--r--README112
1 files changed, 43 insertions, 69 deletions
diff --git a/README b/README
index 06cf28a..97deaf3 100644
--- a/README
+++ b/README
@@ -1,97 +1,71 @@
-NAME url-picker
+NAME reselect
-SITE http://bitbucket.org/sterlingcamden/urlpicker
+SITE https://git.khirnov.net/urxvt-ext-reselect.git/
-AUTHOR Chip Camden
-
-DATE September, 2010
+AUTHOR Anton Khirnov,
+ based on url-picker by Chip Camden
DESCRIPTION
-Perl extension for rxvt-unicode (aka urxvt) to enable quick keyboard
-navigation of URLs shown in the terminal window. The design is similar
-to the 'follow hints' feature of Vimperator
+Perl extension for rxvt-unicode (aka urxvt) to enable quickly grabbing a regex match into
+X11 clipboard. The design is similar to the 'follow hints' feature of Vimperator
(http://vimperator.org/vimperator).
INSTALLATION
-See the man page for urxvtperl(3) for a full discussion of Perl
-extensions. Enable this extension using one of the methods documented
-there. For instance, you could place the script url-picker in
-/usr/local/lib/urxvt/perl, then add the following to .Xdefaults:
+See the man page for urxvtperl(3) for a full discussion of Perl extensions. Enable this
+extension using one of the methods documented there. For instance, you could place the
+script 'reselect' under ~/.urxvt/ext/, then add keybindings for it in .Xresources as
-URxvt.perl-ext: default,matcher,url-picker
-URxvt.keysym.C-0xff0d: perl:url-picker
+URxvt.keysym.M-u: reselect:url
-I find that url-picker works well in combination with matcher, but you
-can leave out the latter if you don't care for it. The above enables, in
-addition to the default behavior, the matcher extension and url-picker.
-It directs the key combination of ctrl+enter to call the on_user_command
-function of url-picker.
+This will bind the 'Meta-u' key combination to the 'url' action, which selects URLs.
OPERATION
-If a portion of the terminal text has been marked for selection, then the
-search for URLs will be restricted to that region. Otherwise, the visible
-text of the termainl will be used.
-
-If no URLs are found, url-picker just pops up an overlay window that
-warns "no URLs found on visible screen" or "no URLs found in visible selected
-text". The overlay disappears after five seconds, but the terminal is
-immediately operable.
-
-If the region contains only one URL, that URL is launched to the browser.
-The browser is determined by X resources url-picker.launcher if defined,
-otherwise URxvt.url-launcher. If neither of these are defined, the
-'sensible-browser' is used. The URL will be passed as the first argument.
-
-If more than one URL is available in the region, url-picker places numbered
-labels over the first characters of each URL on the screen. A prompt
-"Follow: " appears at the bottom of the terminal window, at which you
-can type only numbers, backspace, enter, or escape or `q` (all other input
-is ignored).
-
-Escape (or `q`) exits this mode and removes all overlay windows, without
-doing anything.
+Each action has an associated regex pattern. The extension finds all matches of that
+regex in visible text and assigns a short character sequence ('hint') to each of them.
+The hints are displayed as overlays over the matches.
-Enter launches the URL associated with the number that has been typed, if
-that number matches one of the URL labels. Otherwise, nothing happens.
+If no matches are found, the extesnion just pops up a warning overlay. The overlay
+disappears after five seconds, but the terminal is immediately operable. If the region
+contains only one match, it is immediately grabbed.
-The labels are numbered in ascending order starting with 1 by default. You can
-cause them to be numbered in reverse order (so that the last link is always
-number 1) by setting the resource "URxvt.url-picker.order" to "descending".
+Typing the characters making up a hint grabs the corresponding match into clipboard. The
+backspace key erases the last character typed, if there is one. Escape exits the
+selection mode and removes all overlay windows, without doing anything.
-When typing numbers, if the number typed so far uniquely identifies a
-URL, that URL is launched immediately. Otherwise, the labels that do not
-match the numbers typed so far will be hidden.
+When a match is grabbed, all overlay windows are removed and the cursor position is
+restored to where it was in the terminal window before url-picker was invoked. The match
+that was grabbed is displayed on the bottom row of the terminal window for five seconds.
-The backspace key erases the last number typed, if there is one.
+ACTIONS
-When a URL is launched, all overlay windows are removed and the cursor
-position is restored to where it was in the terminal window before
-url-picker was invoked. The url launched is displayed on the bottom
-row of the terminal window for five seconds.
+The following actions are defined by this extension:
-To avoid surprises, the resource `url-picker.launchsingle` can be set to
-`false` to stop url-picker from automatically launching a single (sole) found
-URL, until its number has been typed.
+url Matches URLs.
+git_hash Mathes git commit hashes.
+message_id Matches angle-quote-enclosed email message IDs.
+user.<n> Matches the user-defined pattern number <n>. Patterns must be
+ numbered consecutively.
RESOURCES
The following resources are recognized by url-picker:
-URxvt.url-launcher Default browser
-URxvt.url-picker.input.backgroundColor Bg color for numbers typed
-URxvt.url-picker.input.foregroundColor Fg color for numbers typed
-URxvt.url-picker.label.backgroundColor Bg color for numbered labels
-URxvt.url-picker.label.foregroundColor Fg color for numbered labels
-URxvt.url-picker.launcher Browser override
-URxvt.url-picker.launchsingle "false" to not auto-launch single url
-URXVT.url-picker.order "descending" numbers in reverse
-URxvt.url-picker.prompt.backgroundColor Bg color for "Follow:" prompt
-URxvt.url-picker.prompt.foregroundColor Fg color for "Follow:" prompt
-URxvt.url-picker.status.backgroundColor Bg color for status messages
-URxvt.url-picker.status.foregroundColor Fg color for status messages
+URxvt.reselect.launchsingle "false" to not auto-grab a single match
+URxvt.reselect.order "descending" to assign hints in reverse order
+URxvt.reselect.pattern.<n> define a custom pattern, which will be available
+ as the 'user.<n>' action
+
+URxvt.reselect.input.backgroundColor Bg color for numbers typed
+URxvt.reselect.input.foregroundColor Fg color for numbers typed
+URxvt.reselect.label.backgroundColor Bg color for numbered labels
+URxvt.reselect.label.foregroundColor Fg color for numbered labels
+URxvt.reselect.prompt.backgroundColor Bg color for "Follow:" prompt
+URxvt.reselect.prompt.foregroundColor Fg color for "Follow:" prompt
+URxvt.reselect.status.backgroundColor Bg color for status messages
+URxvt.reselect.status.foregroundColor Fg color for status messages
Colors must be specified using urxvt color indices as described in
the urxvt(1) man page under COLORS AND GRAPHICS.